<template>
	<view class="content pc-tou-gao " >
		<view class="scroll-fix" >
			<view class="d-kuan-juzhong ">
				<!--头部-->
				<view class="d-kuan pc-dingbu ">
					<DToubu 
					@login-success="handleLoginSuccess"
					:dengluxianshi="denglu_xianshi"
					@update-dengluxianshi="handleUpdateDengluxianshi"
					@www-data="wwwdataget"
					@leixing="leixing_id"
					@denglu-fabu="denglu_fabu"
					></DToubu>
				</view>
				<!--头部-->
				<!--下面内容-->
				<view class="d-kuan d-clear">
					<uv-row customStyle="margin-bottom: 10px" :gutter="10">
						<!-- #ifdef H5 -->
						<uv-col span="2" class="pc-yincang">
							<!--左边导航-->
							<view class="d-daohang d-you-10 pc-yincang d-y-gundong d-shang-20" id="zuo-daohang" :style="{height: leftNavHeight}">
								<view class="d-daohang-5 " >
									<Ddaohang @denglu-fabu="denglu_fabu" @leixing="leixing_id"></Ddaohang>
								</view>
							</view>
						</uv-col>
						<!-- #endif -->

						<uv-col :span="kuan_shu" class="kuan_zhongjian">
							<view class="pc-neikuang-20" >
								<!--小程序高度-->
								<!--#ifdef MP-WEIXIN-->
								    <view class="d-kuan d-gao-70"></view>
								<!--#endif-->
								<!--海报-->
								
								<view v-if="index_suxing==0" class="d-kuan d-cengci" style="z-index: 0;">
									<view class="d-clear"></view>
									<swiper id="haibao-swiper" :style="{marginTop: '10px', width: '100%', height: swiperHeight + 'px'}" class="d-kuan"  interval="10000" autoplay="true" indicator-color="rgba(255, 255, 255, 0)" indicator-active-color="rgba(255, 255, 255, 0.0)" @change="onSwiperChange">
										<block v-for="(item, index) in haibao_data" :key="index">
											<swiper-item class="swiper-item d-yuanjiao-10" :id="'tupian-'+index" >
													<image  :id="'tupian-'+index" :mode="isH5 && !pc ? 'aspectFit' : 'aspectFill'" :src="item.img" class=" d-yuanjiao-10" 
							:style="{width: '100%', height: swiperHeight + 'px'}" @load="onImageLoad($event, index)"></image>
											</swiper-item>
										</block>
									</swiper>
								</view>
								<!--推荐-->
								<!--view class="d-kuan pc-yincang">
									<view class="d-waigao-20 d-beijing-baise d-yuanjiao-10 d-bianhua-10">
										<view class="d-shangxia-10 d-buhuanhang">
											<view ><uv-tags text="推荐" plain size="mini" type="error"></uv-tags></view>
											<text class="d-zuo-10">推荐标题1</text>
										</view>
										<view class="d-shangxia-10 d-buhuanhang">
											<view ><uv-tags text="推荐" plain size="mini" type="error"></uv-tags></view>
											<text class="d-zuo-10">推荐标题1</text>
										</view>
										<view class="d-shangxia-10 d-buhuanhang">
											<view ><uv-tags text="推荐" plain size="mini" type="error"></uv-tags></view>
											<text class="d-zuo-10">推荐标题1</text>
										</view>
									</view>

								</view-->
								<!--知识-->
								<!--uv-row class="pc-yincang" :customStyle="{marginTop: gao+'px',flexWrap: 'wrap'}" :gutter="20" wrap>
									<uv-col v-for="(list,index) in zhishi_tuijian_data" span="6"  >

										<view class="beijing-1 d-kuan d-buhuanhang d-xia-20" @click="zhishi(list.id)">
											
											<view class="d-zuo d-tu-kuan-110 d-piaofu-0">
												<view v-if="list.moshi==0" class="d-piaofu-1">免费</view>
												<view v-else class="d-piaofu-1">付费</view>

												<uv-image :src="list.thumb" width="190rpx" height="240rpx" radius="10"></uv-image>
											</view>
											<view class="d-kuan d-neikuang-10">
												<view class="d-chaochu-1 d-jiacu">{{list.title}}</view>
												<view class="d-chaochu-2 d-ziti-14 d-wenzi-yanse-hui d-shangxia-5">
													{{list.description}}
												</view>
												<view class="d-chaochu-2 d-ziti-12 d-wenzi-yanse-hui d-shangxia-10">
													<uv-icon name="arrow-right" color="#a7a7a7" labelColor="#a7a7a7" size="12" :label="list.catname"></uv-icon>
												</view>
												<view class="d-buhuanhang d-shangxia-10">
													<view class="d-baifen-50">
														<view class="d-zuo  d-chaochu-1 d-ziti-12 d-wenzi-yanse-hui ">
															共 {{ list.kecheng_total }} 讲
														</view>
													</view>
													<view class="d-baifen-50">
														<view class="d-you d-chaochu-1 d-ziti-12 d-wenzi-yanse-hui ">
															已有 {{ list.xuexi_tongji }} 加入学习
														</view>
													</view>
												</view>

											</view>
										</view>
									</uv-col>

								</uv-row-->
								<!--h5 小图标-->
								<!--view class="d-kuan">
									<view class="d-waigao-20 d-beijing-baise d-yuanjiao-10 ">
										<swiper :indicator-dots="true" class="swiper">
											<swiper-item>
												<uv-grid :col="4" @click="click">
													<uv-grid-item v-for="(item,index) in tubiao_data" :key="index">
														<uv-icon :customStyle="{paddingTop:40+'rpx'}" :name="item.name" size="26" labelSize="12"  :labelStyle="{color: '#999 !important'}"
														labelColor="#999"></uv-icon>
														<text class="grid-text">{{item.title}}</text>
													</uv-grid-item>
												</uv-grid>
												
											</swiper-item>
											<swiper-item>
												<uv-grid :col="4" @click="click">
													<uv-grid-item v-for="(item,index) in tubiao_data" :key="index">
														<uv-icon :customStyle="{paddingTop:40+'rpx'}" :name="item.name" :size="26" :labelSize="12"  labelColor="#eee"></uv-icon>
														<text class="grid-text">{{item.title}}</text>
													</uv-grid-item>
												</uv-grid>

											</swiper-item>
										</swiper>
									</view>
								</view-->
								<!--uv-divider text="最新分享" textSize="20"></uv-divider-->
								<view class="d-clear"></view>
								<view v-if="shenhe_shu > 0 && uid" class="d-kuan ">
									<view class="d-shang-10">
										<uv-button @click="shenhe" type="primary" size="small" iconColor="#ffffff" icon="chat" shape="circle" color="linear-gradient(to right, rgb(59, 216, 169), rgb(46, 127, 213))" :text="'新贴审核('+shenhe_shu+')'"></uv-button>
									</view>

								</view>
								<!--view class="d-clear"></view>
								<view class="d-waigao-20 d-beijing-baise d-yuanjiao-10 d-bianhua-10">
									<uv-row customStyle="flex-wrap: wrap" :gutter="20" wrap>
										<uv-col v-for="(list,index) in list_fuwu" span="4" :key="index" :id="'fuwu_gao_' + index" class="fuwu_gao_item" @click="fuwu_gao(list.id)">
											<image :src="list.thumb" :style="{width: '100%', height: fuwugaozhi, borderRadius: '10px'}" radius="10" mode="aspectFit"></image>
											
											<view >费用 {{ list.price }} </view>
											<view class="d-shang-5" v-if="list.id ==23">更新费用 0 元 </view>
											<view class="d-shang-5" v-if="list.id ==24">更新费用 298 元/年 </view>
											<view class="d-shang-5" v-if="list.id ==25">更新费用 298 元/年 </view>
											<view class="d-shang-5">赠送创业金 {{ list.zengsonge }} 元 </view>

										</uv-col>
									</uv-row>
								</view-->
								<view class="d-clear"></view>
								<view v-if="list_tubiao.length > 0 && index_suxing==0" class="d-waigao-20 d-beijing-baise d-yuanjiao-10 d-bianhua-10" style="display: flex; flex-wrap: wrap;">
									<view v-for="(list,index) in list_tubiao" :key="index" @click="go_yemian(list.ymlx,list.www)" style="flex: 1; min-width: 18%; text-align: center; margin-top: 10px;">
										<uv-icon :customStyle="{paddingTop:'0rpx', display:'inline-block', margin: '0 auto'}" :name="list.tubiao" size="35" labelSize="12" :labelStyle="{color: '#999 !important', textAlign: 'center'}"
										labelColor="#999"></uv-icon>
										<text class="grid-text d-wenzi-14" style="display: inline-block; padding-bottom: 10px;color: #959595;" >{{list.title}}</text>
									</view>
								</view>
								<view class="d-clear"></view>
								<view class="d-waigao-20 d-beijing-baise d-yuanjiao-10 d-bianhua-10" v-if="wwwData && wwwData.setting && wwwData.setting.config.TISHI && index_suxing==0">
									{{wwwData && wwwData.setting && wwwData.setting.config.TISHI}}
								</view>
								<view class="d-clear"></view>
								<!--统计-->
								<Ddingzhi 
								    v-if="config.getXiazai == '1' && index_suxing==0"
								    
								/>
									
								<Dtuijian
								    v-if="index_suxing==0"
								    :kuan="kuan_zhongjian_data"
									
								></Dtuijian>
								
								<view v-if="wwwData && wwwData.setting && wwwData.setting.quan_shuxing != 1  && index_suxing==0" class="d-clear"></view>

								<view v-if="wwwData && wwwData.setting && wwwData.setting.quan_shuxing != 1 && index_suxing==0" class="d-waigao-20 d-beijing-baise d-yuanjiao-10 d-bianhua-10">
									
									<view class="d-kuan" style="display: flex; justify-content: space-around;">
										<uv-tabs :list="list_shuxing" lineColor="#02c7b6" @click="click_suxing" :itemStyle="{ height: '44px',color:'#2daf99',fontSize: '20px'}"></uv-tabs>
										
									</view>
								
								</view>
								<!--推荐-->
								<view  v-if="list_tuijian_tie.length > 0 && index_suxing==0 && tie_suxing == 0" class="d-waigao-20 d-beijing-baise d-yuanjiao-10 d-bianhua-10">
									<uv-cell-group :border="false">
										<uv-cell v-for="(list,index) in list_tuijian_tie" :key="index" @click="tiezi(list.cid,list.id)">
											<!-- 自定义左侧标题下面的内容 -->
											<template v-slot:title>
												<view class="d-buhuanhang" >
													<uv-tags style="width: 40px;" text="推 荐" size="mini" type="error" shape="circle"></uv-tags> <text class="d-chaochu-1" style="line-height: 22px;margin-left: 10px;">{{list.title}}</text>
												</view>
											</template>
											<!-- 自定义右侧图标 -->
											<template v-slot:right-icon>
												<uv-icon size="30rpx" name="arrow-right"></uv-icon>
											</template>
										</uv-cell>
										
									</uv-cell-group>
								
								</view>


								<view class="d-clear"></view>
								<!--内容-->
									<view v-if="!isLoading && Array.isArray(tiezi_list) && tiezi_list.length === 0" class="d-kuan d-juzhong d-shangxia-20">
										<uv-empty text="暂无内容，点击刷新" mode="list" @click="refreshFirstScreen"></uv-empty>
									</view>
									<uv-row customStyle="flex-wrap: wrap" :gutter="20" wrap >
													<uv-col v-for="(tie,index) in tiezi_list" span="12" :key="tie.id || index">
											<view class="d-waigao-20 d-beijing-baise d-yuanjiao-10 d-bianhua-10 d-tuijian-0" style="position: relative;">
												<!--推荐-->
												<view v-if="tie.tuijian == 1 || tie.quanzhantuijian ==1 " class="d-tuijian-1" style="position: absolute; top: 10px; right: 10px; z-index: 1;">
													<image src="/static/images/tui.png" mode="aspectFill" class="d-img-50"></image>
												</view>
												<!--头像-->
												<view v-if="tie.quan_touxiang==1" class="d-kuan " >
													<view class="d-baifen-50 d-zuo d-buhuanhang">
														<view class="d-gaokuang-40 d-kuanggao-40 d-yuanjiao-40 d-box" @click="go_quan(tie.quan_id)">
														    <image v-if="tie.quan_tubiao" :src="tie.quan_tubiao" mode="aspectFill" class="d-img-40 d-yuanjiao-50  d-img-anhei"></image>
															<image v-else src="/static/assets/images/avatar.png" mode="aspectFill" class="d-img-40 d-yuanjiao-50  d-img-anhei"></image>
														</view>
														<view class="d-kuan d-zuo-10" @click="go_quan(tie.quan_id)">
															<view class="d-wenzi-14 d-jiacu d-wenzi-hei">{{ tie.quan_ming }} </view>
															<view class="d-wenzi-14 d-wenzi-yanse-hui d-chaochu-1">{{ tie.fabushijian }}</view>
														</view>
													</view>
													<view class="d-baifen-50 d-you">
														<view class=" d-neirong-you d-you" >
															<!--view v-if="denglu_xianshi == 1" @click="getGuanzhus(index,item.uid)" class="d-you d-kuan-40 d-beijing-hei d-wenzi-yanse-bai-0 d-neikuang-zuoyou-2-shangxia-4 d-wenzi-12 d-yuanjiao-50 d-neirong-juzhong" >已关注</view>
															<view v-else @click="getGuanzhus(index,item.uid)" class="d-kuan-40 d-beijing-hui-f6 d-wenzi-hei d-neikuang-zuoyou-2-shangxia-4 d-wenzi-12 d-yuanjiao-50 d-neirong-juzhong" >关 注</view-->
														</view>
													</view>
												</view>
												<view v-else class="d-kuan">
													<view class="d-baifen-50 d-zuo d-buhuanhang">
														<view class="d-gaokuang-40 d-kuanggao-40 d-yuanjiao-40 d-box" @click="getgeren(tie.uid)">
														    <image v-if="tie.touxiang" :src="tie.touxiang" mode="aspectFill" class="d-img-40 d-yuanjiao-50  d-img-anhei"></image>
															<image v-else src="/static/assets/images/avatar.png" mode="aspectFill" class="d-img-40 d-yuanjiao-50  d-img-anhei"></image>
														</view>
														<view class="d-kuan d-zuo-10" @click="getgeren(tie.uid)">
															<view class="d-wenzi-14 d-jiacu d-wenzi-hei">{{ tie.mingcheng }} </view>
															<view class="d-wenzi-14 d-wenzi-yanse-hui d-chaochu-1">{{ tie.fabushijian }}</view>
														</view>
													</view>
													<view class="d-baifen-50 d-you">
														<view class=" d-neirong-you d-you" >
															<!--view v-if="denglu_xianshi == 1" @click="getGuanzhus(index,item.uid)" class="d-you d-kuan-40 d-beijing-hei d-wenzi-yanse-bai-0 d-neikuang-zuoyou-2-shangxia-4 d-wenzi-12 d-yuanjiao-50 d-neirong-juzhong" >已关注</view>
															<view v-else @click="getGuanzhus(index,item.uid)" class="d-kuan-40 d-beijing-hui-f6 d-wenzi-hei d-neikuang-zuoyou-2-shangxia-4 d-wenzi-12 d-yuanjiao-50 d-neirong-juzhong" >关 注</view-->
														</view>
													</view>
												</view>
												<view class="d-clear"></view>
												<!--内容-->
												<view class="d-zuoyou-neikuang-10 ">
													<!--标题-->
													<view v-if="tie.quan_daohang && tie.quan_daohang.id">
														<image v-if="tie.quan_daohang && tie.quan_daohang.tubiao" :src="tie.quan_daohang && tie.quan_daohang.tubiao" mode="aspectFill" class="d-img-30 d-zuo d-you-10" style="margin-top: -5px;"></image>
														<view v-else class="d-diy-tubiao d-zuo d-you-10" :style="{ backgroundColor: tie.quan_daohang && tie.quan_daohang.yanse }">{{tie.quan_daohang && tie.quan_daohang.jiancheng}}</view>
													</view>
													<!--view v-if="tie.leixing ==1" class="d-wen-tubiao d-zuo d-you-10">问</view-->
													<view v-if="tie.leixing ==2" class=" d-zuo d-you-10">
													
                                                        <image :src="getTitleIcon(tie.title)" mode="aspectFill" class="d-img-30"></image>
													</view>
													<view 
														class="d-jiacu d-shang-10 d-wenzi-16 d-xia-10 d-younei-10  d-wenzi-hei d-jiacu" 
														@click="tiezi(tie.cid,tie.id)"
													>{{ tie.title }}</view>
													<!--进度-->
													<view v-if="tie.jindu && tie.jindu.jindu == 1" class="d-kuan" @click="tiezi(tie.cid,tie.id)">
														<uv-steps :current="tie.jindu && tie.jindu.zhuangtai" class="d-shang-20">
															<uv-steps-item title="已准备" customStyle="font-size: 12rpx;" :desc="tie.jindu && tie.jindu.tianjiashijian"></uv-steps-item>
															<uv-steps-item title="进行中" :desc="tie.jindu && tie.jindu.kaishishijian"></uv-steps-item>
															<uv-steps-item title="已完成" :desc="tie.jindu && tie.jindu.jieshushijian"></uv-steps-item>
														</uv-steps>
													</view>
													<!--内容-->
													<view 
													    class="d-wenzi-12 d-wenzi-yanse-hui d-shang-10 d-xia-10 d-younei-10  d-chaochu-3"
													    @click="tiezi(tie.cid,tie.id)"
													>
														{{ tie.jianjie }}
													</view>
													<view v-if="tie.leixing ==1" class="">
														<uv-tags
														v-if="tie.pinglun > 0"
														:text="'已经有'+tie.pinglun+'条回答'" 
														size="mini"
														type="success" 
														shape="circle" 
														icon="edit-pen" 
														plain 
														plainFill
														bgColor="#ffffff"
														borderColor="#ffffff"
														color="#02c7b6"
														iconColor="#02c7b6"
														></uv-tags>
														
													</view>
													<!--图片-->
													<view class="d-fu-kuan-10 d-buhuanhang" @click="tiezi(tie.cid,tie.id)">
														<block v-for="(itemtu, indextu) in tie.tupian" :key="indextu">
																<view class="d-kuan-30 d-zuo d-liangbian-10" v-if="indextu < 3">
																	<image :src="itemtu" mode="aspectFill" class="d-img-100-bai d-yuanjiao-6 d-yinying-10 d-img-anhei"></image>
																</view>
														</block>
														<view class="d-clear"></view>
													</view>
													<view class="d-clear"></view>
												<!--音频-->
												<NlAudioPlayer
												    :id="'yinpin_'+index"
												    v-if="tie.yinpin && tie.yinpin[0]"
													:key="'yinpin_'+index+'_'+(audioSrcMap[index] || '')"
													:src="audioSrcMap[index] || ''"
													style="margin: 20px 0;"
													:bar-bg-style="{ borderRadius: '50px' }"
													:bar-style="{ backgroundColor: '#27a393', borderRadius: '50px' }"
													:dot-style="{ width: '30rpx', height: '30rpx', backgroundColor: '#2ebdac' }"
													:ref="el => this.setAudioRef(el, index)"
													@click="onAudioPlay(index)"
												></NlAudioPlayer>
													<!--视频-->
													<view v-if="tie.shipin_kaiguan == 1 && tie.shipin && tie.shipin[0] && tie.shipin[0].shipin" class="d-shang-10">
														<video 
															class="d-yuanjiao-10 d-kuan d-video-height"
															:key="'shipin_'+index+'_'+(videoSrcMap[index] || '')"
															:src="videoSrcMap[index] || ''"
															:poster="tie.shipin && tie.shipin[0] && tie.shipin[0].shipintu"	
															controls
															:ref="el => this.setVideoRef(el, index)"
															@click="onVideoClick(index)"
														>
														</video>
													</view>
													<view class="d-clear"></view>
													<!--评论-->
													<view class="d-kuan d-shang-10">

														<view class="">
															<uv-row customStyle="flex-wrap: wrap" :gutter="20" wrap>
																<uv-col span="3" >
																	<view v-if="tie.quan_touxiang==1" class="d-biaoqian" @click="getgeren(tie.uid)">
																		<image v-if="tie.touxiang" :src="tie.touxiang" mode="aspectFill"  class="d-img-20 d-yuanjiao-50  d-img-anhei"></image>
																		<image v-else src="/static/assets/images/avatar.png" mode="aspectFill" class="d-img-20 d-yuanjiao-50  d-img-anhei"></image>
																		<view class="d-chaochu-1 d-zuo-5 " style="color: #909090;">{{tie.mingcheng}}</view>
																		
																	</view>
																	<view v-else class="d-biaoqian" @click="go_quan(tie.quan_id)">
																		
																		<uv-tags 
																		@click="go_quan(tie.quan_id)"
																		:text="tie.quanzi.slice(0, 2)" 
																		size="mini"
																		type="success" 
																		shape="circle" 
																		icon="tags-fill" 
																		plain 
																		plainFill
																		bgColor="#ffffff"
																		borderColor="#02c7b6"
																		color="#02c7b6"
																		iconColor="#02c7b6"
																		></uv-tags>
																	</view>

																</uv-col>
																<uv-col span="6"   @click="tiezi(tie.cid,tie.id)">
																	<uv-row customStyle="flex-wrap: wrap" :gutter="20" wrap>
																		
																		<uv-col span="4">
																			<uv-icon name="heart" color="#bbbbbb" size="18" :label="tie.shoucang" labelColor="#bbbbbb"></uv-icon>
																		</uv-col>
																		<uv-col span="4">
																		    <uv-icon name="chat" color="#bbbbbb" size="18" :label="tie.pinglun" labelColor="#bbbbbb"></uv-icon>
																		</uv-col>
																		<uv-col span="4" >
																			<uv-icon name="thumb-up" color="#bbbbbb" size="18" :label="tie.dianzan" labelColor="#bbbbbb"></uv-icon>
																		</uv-col>
																	</uv-row>

																</uv-col>
																<uv-col span="3" customStyle="display: flex; justify-content: flex-end; " @click="tiezi(tie.cid,tie.id)">
																	<view class="d-kuan" style="display: flex; justify-content: flex-end; ">
																		<uv-avatar-group :urls="tie.dianzan_touxiang" size="22" gap="0.4"></uv-avatar-group>
																	</view>
																</uv-col>
															</uv-row>
														</view>
													</view>
												</view>
											</view>

										</uv-col>
										<!-- 加载状态提示 -->
												<view class="d-kuan d-juzhong d-shangxia-20" v-if="isLoading" style="pointer-events: none;">
													<uv-loading-icon></uv-loading-icon>
  												</view>
  										<view class="d-kuan d-juzhong d-shangxia-20 d-wenzi-hui" v-if="noMoreData">
  										    <uv-divider text="没有更多数据了"></uv-divider>
											  <uv-gap height="100" bgColor="#bbb"></uv-gap>
  										</view>
									</uv-row>
							    </view>
						</uv-col>
						<!-- #ifdef H5 -->
						<uv-col span="3" class="pc-yincang">
							<view class="d-daohang d-you-10 pc-yincang d-shang-20" id="zuo-daohang" :style="{height: leftNavHeight}">
								<view class="d-you-kuang">
									<view class="d-kuan  " id="yuedu_gao" :style="{height: leftNavHeight,width: rightColWidth,marginTop: '10px'}">
										<view class=" gundong-2"  style="height: 100%; display: flex; flex-direction: column;overflow-y: auto;">
											<view v-if="wwwData && wwwData.setting && wwwData.setting.quan_moshi == 0" class="d-yuanjiao-10  d-beijing-e3 d-bianhua-10 d-xia-10">
												<view class="">
													<uv-button text="申请圈子"  @click="shenqing()" shape="circle" size="small" color="linear-gradient(to right, rgb(66, 83, 216), rgb(213, 51, 186))"></uv-button>
													<view class="d-shang-10 d-juzhong">{{ wwwData && wwwData.setting && wwwData.setting.quan_tishiyu }}</view>
												</view>
											</view>
											<view class="d-yuanjiao-10  d-beijing-e3 d-bianhua-10 ">
												
												<view class="d-kuan">
													<view class="d-jiacu d-wenzi-16 d-zuo">热门圈子</view>
													<view class="d-wenzi-14 d-you" @click="quanzi_url">全部</view>
													<view class="d-clear"></view>
												</view>
												
												<view v-for="(list,index) in list_remen_data" :key="index" @click="go_quan(list.id)" class=" d-wenzi-16 d-quxian-0 d-chaochu d-shangxia-5">
													<view class=" d-buhuanhang">
														<view v-if="(index+1) <= 3" class="d-zuo d-piaofu-0" style="display: flex; justify-content: center; align-items: center;">
															<image :src="'/static/images/top_'+(index+1)+'.png'"  style="width: 36rpx; height: 48rpx; margin-right: 10px;"></image>
														</view>
														<view v-else class="d-zuo d-piaofu-0" style="display: flex; justify-content: center; align-items: center;">
															<view style="width: 36rpx; height: 36rpx;margin-right: 10px; background-color: #d4d4d4;border-radius: 50px;color: #909090; display: flex; justify-content: center; align-items: center;font-size: 12px;" >{{index+1}}</view>
														</view>

														<view class="d-zuo d-piaofu-0" style="display: flex; justify-content: center; align-items: center;">
															<uv-image :src="list.thumb" width="80rpx" height="80rpx" radius="50"></uv-image>
														</view>
														<view class="d-kuan d-neikuang-10 d-piaofu-jiage-0">
														
															<view class="d-chaochu-1 d-jiacu">{{list.title}}</view>

														
															<view class=" d-ziti-12 d-wenzi-yanse-hui d-shangxia-5 d-buhuanhang">

																<view class="d-chaochu-1 ">帖子：{{list.quantie_total}}</view>
															</view>
														</view>
													</view>
													<uv-line color="#d9d9d9"></uv-line>
													
												</view>

											</view>
											<!--推荐圈子-->
											<view class="d-yuanjiao-10 d-waigao-20 d-beijing-e3 d-bianhua-10 ">
												<view class="d-kuan d-jiacu d-wenzi-16">
													推荐圈子
												</view>
												<uv-row customStyle="margin-bottom: 10px">
													<!--uv-col span="3" customStyle="display: flex; flex-direction: column; align-items: center;margin-top: 10px">
														<uv-avatar src="/static/img/011.jpg" shape="square"></uv-avatar>
														<view class="demo-layout bg-purple">321</view>
													</uv-col>
													<uv-col span="3" customStyle="display: flex; flex-direction: column; align-items: center;margin-top: 10px">
														<uv-avatar src="/static/img/011.jpg" shape="square"></uv-avatar>
														<view class="demo-layout bg-purple">321</view>
													</uv-col>
													<uv-col span="3" customStyle="display: flex; flex-direction: column; align-items: center;margin-top: 10px">
														<uv-avatar src="/static/img/011.jpg" shape="square"></uv-avatar>
														<view class="demo-layout bg-purple">321</view>
													</uv-col>
													<uv-col span="3" customStyle="display: flex; flex-direction: column; align-items: center;margin-top: 10px">
														<uv-avatar src="/static/img/011.jpg" shape="square"></uv-avatar>
														<view class="demo-layout bg-purple">321</view>
													</uv-col-->
												</uv-row>
											</view>
											<!--推荐课程-->
											<view class="d-yuanjiao-10 d-waigao-20 d-beijing-e3 d-bianhua-10 ">
												<view class="d-kuan d-jiacu d-wenzi-16">
													微信访问
												</view>
												<view class="d-kuan d-buhuanhang d-shang-20">
													<view style="width: 100px;" class="  d-neikuang-10 d-beijing-bai d-yuanjiao-10">
														<uv-qrcode ref="qrcode" size="80px" :value="config.getDomain"></uv-qrcode>
													</view>
													<view class="d-kuan">
														<view class="d-jiacu d-zuo-10">
															{{wwwData && wwwData.setting && wwwData.setting.config.SITE_NAME}}
														</view>
														<view class="d-zuo-10 d-wenzi-12 d-shang-5">
															{{ wwwData && wwwData.setting && wwwData.setting.config.SITE_JIANJIE }}
														</view>
													</view>
												</view>

											</view>
											<view class="d-yuanjiao-10 d-shang-20 d-wenzi-12" style="color: #909090;" >
												<view>
													公司名称：{{wwwData && wwwData.setting && wwwData.setting.config.GONGSI_MINGCHENG}}
												</view>
												<view class="d-shang-5">
													公司地址：{{wwwData && wwwData.setting && wwwData.setting.config.GONGSI_DIZHI}}
												</view>
												<view class="d-shang-5">
													联系方式：{{wwwData && wwwData.setting && wwwData.setting.config.GONGSI_KEFU}}
												</view>
											</view>
											<view class="d-yuanjiao-10 d-shang-20 d-wenzi-10 d-xia-10" style="color: #dedede;margin-top: 100px;" >
												<a href="https://www.duixin.cc" target="_blank" class="d-link" style="color: #dedede;" >
													Powered by 对信 {{ config.getDuixinbanbenhao }}
												</a>
											</view>
											<!--底部-->
											<!--view class="d-kuan d-waigao-20 d-bianhua-10 ">
												
											</view-->																		
										</view>																								
									</view>
								</view>
							</view>
						</uv-col>
						<!-- #endif -->
					</uv-row>					
				</view>
				<!--下面内容-->
			</view>
			<view class="d-clear"></view>
		</view>
		
		
		<!--底部-->
		<view class="d-kuan d-waigao-20 d-bianhua-10 pc-yincang"></view>

		<view class="d-clear pc-yincang"></view>
		<view class="d-weibu pc-yincang">
			<Dweibu></Dweibu>
		</view>
		<!--vip-->
        <Dvip 
		    v-if="wwwData && wwwData.setting && wwwData.setting.quan_fufei == 1 &&  wwwData && wwwData.setting && wwwData.setting.quan_moshi == 1 && (u_data &&  u_data.vip_zu==0 || !uid)"
		    :kuan_shu="kuan_shu" 
		    :wwwdata="wwwData"
			:gao_data="1"
			:dingzhi="config.getXiazai"
			@denglu="denglu_weibu"
		></Dvip>
		<!--底部登录-->
		<Dweibudenglu
			ref="weibudenglu"
			:denglu_xianshi_weibu="denglu_xianshi_weibu"
			@denglu_close_get="denglu_close_get"
		>
		</Dweibudenglu>
		
		<Dfufei></Dfufei>

	</view>
</template>

<script>
    import Api from '@/utils/api.js'; 
	import UApi from '@/utils/u_api.js';
	import config from '@/utils/config.js'; 
	import QuanApi from '@/utils/quan_api.js';
	import YingyongApi from '@/utils/yingyong_api.js';
	import { getRequest,postRequest } from '@/utils/wxRequest.js';
    //引入组件 d-toubu
    import DToubu from '@/components/d-toubu/d-toubu.vue'
	import Ddaohang from '@/components/d-daohang/d-daohang.vue'
	import Dweibu from '@/components/d-weibu/d-weibu.vue'
	import Dfufei from '@/components/d-fufei/d-fufei.vue'
		
	import NlAudioPlayer from '@/uni_modules/nl-audio-player/components/nl-audio-player/nl-audio-player.vue'
    import Dtuijian from '@/components/d-tuijian/d-tuijian.vue'
	import Dweibudenglu from '@/components/d-weibu-denglu/d-weibu-denglu.vue'
	import Ddingzhi from '@/components/d-dingzhi/d-dingzhi.vue'
	import Dvip from '@/components/d-vip/d-vip.vue'
	export default {
		data() {
			return {
				title: 'Hello',
				wwwData: null, // 网站数据
				leftNavHeight: '500rpx', // 默认高度
				audioPlayers: {}, // 存储所有音频播放器引用
                audioSrcMap: {}, // 懒加载音频src映射（索引->src），点击播放时再设置
                videoPlayers: {}, // 存储所有视频元素引用
                videoSrcMap: {}, // 懒加载视频src映射（索引->src），点击播放时再设置
                rightColWidth: '300px', // 默认宽度
                currentPlayingAudio: null, // 当前正在播放的音频索引
                playTimeout: null, // 播放定时器ID
				rightColLeft: '0px', // 添加这个属性
				erjidata:[],
				erjiindex:'',//当前激活的二级菜单索引
				activeIndex: -1, // 当前激活的一级菜单索引
				zhishi_tuijian_data:[], // 知识推荐数据
				zhishi_daohang_list:[], // 知识导航列表
				zhishi_list:[], // 知识列表
				haibao_data:[], // 海报数据
				imageSize: {
        		    width: 0,
        		    height: 0
        		},
				tubiaolist: 
				['integral', 'kefuv-ermai', 'coupon', 'gift', 'scan',
					'pause-circle', 'volume-off', 'email', 'list'
				],
				denglu_xianshi:0, // 登录显示

				tiezi_list:[], // 帖子列表
				tieziCache: {}, // 列表缓存：按cid+导航+属性维度缓存数据与分页
				tabClickLock: false, // uv-tabs点击锁：防止同一时刻多次触发click导致重复调用接口
				suxingFilter: {}, // 当前属性筛选的持久参数
				activeFilterSource: '', // 记录当前筛选来源：'leixing' 或 'suxing'
				lastSuxingId: null, // 上一次选择的属性分类id，用于防止重复加载+

				currentPage: 1, //下拉加载
    			pageSize: 20, //下拉加载
    			isLoading: false, //下拉加载
    			noMoreData: false, //下拉加载
				kuan_shu: 7, //格大小
				swiperHeight: '250',
				activeHaibaoIndex: 0, // 当前swiper的激活索引
				lastHaibaoAspectRatio: null, // 最近一次图片的宽高比（用于窗口缩放计算高度）
				resizeMeasureTimer: null, // 窗口缩放测量防抖计时器
				gao: '20', //图片高度
				fuwugaozhi: '100px', // 服务项图片高度
				scrollTimeout: null, // 滚动防抖计时器
				
				// 首次进入首页时，禁止自动触发第二页加载，待用户主动滚动后再允许
				isFirstEnter: true,
				hasUserScrolled: false,
				// 导航到帖子详情期间，禁止触发加载，防止返回后页码不稳定
				isNavigating: false,
				// 切换分类期间，禁止触发滚动加载，避免并发重复请求
				isSwitchingCategory: false,
				// 新增：返回首页短暂禁用触底加载的时间戳
				disableLoadMoreUntil: 0,
				
				shenhe_shu:0,//审核帖子数量
				list_fuwu:[],//服务列表
				list_shuxing:[
					{
						id:0,
						name: '全部',
					},
					{
						id:1,
						name: '图文',
					},
					{
						id:2,
						name: '视频',
					},
					{
						id:3,
						name: '音频',
					},
					{
						id:4,
						name: '附件',
					},
					{
						id:5,
						name: '付费文章',
					},
				],
				list_fenxing:[
					{
						id:1,
						name:'图文',
					}
				],
				list_tubiao:[],
				list_remen_data:[],
				wwwData: {}, // 新增属性，设置默认domain值
				config: config,
				index_suxing:0,
				tie_suxing:0,
				kuan_zhongjian_data: 250, // 中间宽度值
				denglu_xianshi_weibu:0,// 登录显示
				list_tuijian_tie:[],
				u_data:{},//用户信息
				tabHeight: 0, // tab高度
				//pc:false
				list_tui_tie:[], //推荐圈子
			}
		},
		components: {
  		    DToubu,
			Ddaohang,
			Dweibu,
			NlAudioPlayer,
			Dtuijian,
			Dweibudenglu,
			Ddingzhi,
			Dfufei,
			Dvip
  		},
		mounted() {
			//var m = this.$store.state;
			//console.log('mmmm',m);
			
		    this.setLeftNavHeight();
			this.getRightColWidth(); // 添加这行
			this.getFuwuGaoWidth(); // 添加这行，计算服务项图片宽度
			this.getKuanZhongjianWidth(); // 添加这行，获取中间宽度
		    // 添加窗口大小变化监听
			// #ifdef H5
		    window.addEventListener('resize', this.setLeftNavHeight);
            window.addEventListener('resize', this.getRightColWidth); // 添加这行
            window.addEventListener('resize', this.getFuwuGaoWidth); // 添加这行，计算服务项图片宽度
            window.addEventListener('resize', this.getKuanZhongjianWidth); // 添加这行，窗口大小变化时重新计算中间宽度
            window.addEventListener('resize', this.updateHaibaoLastOnResize); // 跟随浏览器大小变化更新海报高度缓存
			// 添加滚动事件监听（首次进入时仅标记用户滚动，避免自动触发第二页加载）
			window.addEventListener('scroll', this.onScrollEvent);
			document.addEventListener('scroll', this.onScrollEvent);
			document.addEventListener('touchmove', this.onScrollEvent);
			var e = this;
			
			// #endif
			
		},
    	beforeDestroy() {
			// #ifdef H5
			// 移除监听
			window.removeEventListener('resize', this.setLeftNavHeight);
			window.removeEventListener('resize', this.getRightColWidth); // 添加这行
			window.removeEventListener('resize', this.getFuwuGaoWidth); // 添加这行
			window.removeEventListener('resize', this.getKuanZhongjianWidth); // 添加这行
            window.removeEventListener('resize', this.updateHaibaoLastOnResize);
            window.removeEventListener('scroll', this.onScrollEvent);
            document.removeEventListener('scroll', this.onScrollEvent);
            document.removeEventListener('touchmove', this.onScrollEvent);
			
			// #endif
			// 清除播放定时器
			if (this.playTimeout) {
				clearTimeout(this.playTimeout);
			}
			// 清除滚动防抖计时器
			if (this.scrollTimeout) {
				clearTimeout(this.scrollTimeout);
				this.scrollTimeout = null;
			}
			// 组件卸载时关闭所有音频
			this.closeAllAudios();
		},    
		onHide() {
				// 页面隐藏：保留 leixing_id 和 activeLei，返回首页时沿用用户选择
				// uni.removeStorageSync('leixing_id');
				// uni.removeStorageSync('activeLei');
				//console.log('页面隐藏，保留leixing_id和activeLei');
				
				// 停止所有音频播放
				this.closeAllAudios();
				
				// 防止在子页面加载过程中返回导致首页 isLoading 卡住
				this.isLoading = false;
				if (this.scrollTimeout) {
					clearTimeout(this.scrollTimeout);
					this.scrollTimeout = null;
				}
				// 重置用户滚动标记，返回首页后需用户再次滚动才触发加载
				this.hasUserScrolled = false;
			},
		onUnload() {
			// 页面卸载：保留 leixing_id 和 activeLei，便于下次进入首页沿用筛选
			// uni.removeStorageSync('leixing_id');
			// uni.removeStorageSync('activeLei');
			//console.log('页面卸载，保留leixing_id和activeLei');
			
			// 停止所有音频播放
			this.closeAllAudios();
		},
		onShow() {
			this.getTabHeight();
				//var m = this.$store.state;
				//console.log('12300000:', this.$store.state.memberuid);
				//
				// 每次显示首页时，更新当前页面状态到本地存储
				uni.setStorageSync('currentPage', 'index/index');
				
				// 返回首页时确保加载状态重置，避免滚动判断被 isLoading 阻断
				this.isLoading = false;
				// 同时重置“没有更多”标志，避免错误阻断加载
				this.noMoreData = false;
				// 返回首页时重置导航标记，允许滚动触发加载
				this.isNavigating = false;
				if (this.scrollTimeout) {
					clearTimeout(this.scrollTimeout);
					this.scrollTimeout = null;
				}
				// 返回时不再按列表长度校准页码，避免误判到第2页导致立即请求下一页
				if (!Array.isArray(this.tiezi_list) || this.tiezi_list.length === 0) {
					this.currentPage = 1;
				}
				// 返回首页后短暂禁用触底加载，防止瞬间触底导致误触发
				this.disableLoadMoreUntil = Date.now() + 800;
				
				// 移除滚动监听，仅通过onReachBottom触发加载下一页
				// 回到首页后不再自动触发检测，改为等待用户滚动再触发加载
				this.$nextTick(() => {
					// 不自动调用 handleScroll，避免返回后直接触发 page++ 导致跳页
				});
			
				// 返回首页时，直接读取上次缓存的海报高度并应用（PC 始终为 250）
				try {
					if (this.$store && this.$store.state && this.$store.state.kuan && this.$store.state.kuan.pc) {
						this.swiperHeight = 250;
					} else {
						const lastH = uni.getStorageSync('haibaoHeight:last');
						if (lastH && Number(lastH) > 0) this.swiperHeight = Number(lastH);
					}
				} catch (err) {}
			
			//var e = this;
			
			this.haibao_api();
			this.getRightColWidth(); // 新增：返回首页时重新计算右侧列宽与swiper高度
			this.getGao();
			//this.getTiezi_api(e,false);
			this.getShenhe_shu_api();
			//this.get_fuwu_api(); // 去除云端接口
			this.get_tubiao_daohang();
			this.get_remen_api(); //热门
			this.get_tujian_tie_api() ; //热门
			
			//获取本地存储的leixing_id
			/*var leixing_id = uni.getStorageSync('leixing_id');
			if(leixing_id){
				//如果有leixing_id，那么就设置activeLei为leixing_id
				this.activeLei = leixing_id;
			}*/
			// 根据来源恢复筛选，互斥：只恢复一种
			const source = uni.getStorageSync('activeFilterSource') || '';
			const cid = (this.activeIndex && this.activeIndex.id >= 0) ? this.activeIndex.id : 0;
			let data = { categories: cid };
			if (source === 'suxing') {
				const sf = uni.getStorageSync('suxingFilter') || {};
				data = { ...data, ...sf };
			} else {
				const leixing_id = uni.getStorageSync('leixing_id');
				if (leixing_id == 1) data.tuijian = 1;
				if (leixing_id == 2) data.jinghua = 1;
				if (leixing_id == 3) data.remen = 1;
				if (leixing_id == 4) data.reping = 1;
				if (leixing_id == 5) data.guanzhu = 1;
				if (leixing_id == 7) data.shoucang = 1;
				if (leixing_id == 8) data.dianzan = 1;
				if (leixing_id == 9) data.pinglun = 1;
				if (leixing_id == 10) data.lishi = 1;
			}

			// 返回首页后不自动刷新列表，除非是首次进入或列表为空，避免与滚动加载并发导致覆盖
			if (this.isFirstEnter || this.tiezi_list.length === 0) {
				this.getTiezi_api(data,false);
				// 首次进入兜底：若未带筛选，尝试用推荐做首屏
				this.tryFirstLoadFallback(data);
			}
			
			this.getu_api();
			
		},
		onLoad() {
			// 自定义导航栏标题
			uni.setNavigationBarTitle({
				title: this.config.getWebsiteName, //this.config.getWebsiteName
			});
			// #ifdef H5
			try {
				const navEntry = (performance && typeof performance.getEntriesByType === 'function') ? performance.getEntriesByType('navigation')[0] : null;
				const isReload = navEntry ? (navEntry.type === 'reload') : (performance && performance.navigation && performance.navigation.type === 1);
				if (isReload) {
					// 整体刷新页面：清除列表缓存与海报高度缓存
					this.clearListCache();
					try { uni.removeStorageSync('haibaoHeight:last'); } catch (e2) {}
				}
			} catch (e) {}
				// #endif
			},
			onReady() {
				// 页面初次渲染完成后，重新测量并更新缓存高度
				this.$nextTick(() => {
					setTimeout(() => {
						try { this.getGao(); } catch (e) {}
					}, 400);
				});
			},
			computed: {
		  yidenglu() {
		    return (this.$store.state.memberuid && this.$store.state.keycode) ? 1 : 0;
		  },
		  uid() {
		    return this.$store.state.memberuid;
		  },
		  touxiang() {
		    return this.$store.state.member? this.$store.state.member.avatar : '';
		  },
		  name1() {
		    return this.$store.state.member? this.$store.state.member.name : '';
		  },
		  // 添加设备类型计算属性
  			pc() {
  			  return this.$store.state.kuan.pc;
  			},
  			pingban() {
  			  return this.$store.state.kuan.pingban;
  			},
  			yidong() {
  			  return this.$store.state.kuan.yidong;
  			},
  			kuan() {
  			  return this.$store.state.kuan.windowWidth;
  			},
  			isH5() {
  			  // #ifdef H5
  			  return true;
  			  // #endif
  			  return false;
  			}
		},
		watch: {
		  '$store.state.memberuid'(newUid) {
		    if (newUid && (!Array.isArray(this.tiezi_list) || this.tiezi_list.length === 0)) {
		      const cid = (this.activeIndex && this.activeIndex.id >= 0) ? this.activeIndex.id : 0;
		      const source = this.activeFilterSource || uni.getStorageSync('activeFilterSource') || '';
		      let data = { categories: cid, page: 1, gongkai: 1, syxs: 1 };
		      if (source === 'suxing') {
		        const sf = this.suxingFilter && Object.keys(this.suxingFilter).length ? this.suxingFilter : (uni.getStorageSync('suxingFilter') || {});
		        data = { ...data, ...sf };
		      }
		      this.getTiezi_api(data, false);
		    }
		  },
		  '$store.state.keycode'(newCode) {
		    if (newCode && (!Array.isArray(this.tiezi_list) || this.tiezi_list.length === 0)) {
		      const cid = (this.activeIndex && this.activeIndex.id >= 0) ? this.activeIndex.id : 0;
		      const source = this.activeFilterSource || uni.getStorageSync('activeFilterSource') || '';
		      let data = { categories: cid, page: 1, gongkai: 1, syxs: 1 };
		      if (source === 'suxing') {
		        const sf = this.suxingFilter && Object.keys(this.suxingFilter).length ? this.suxingFilter : (uni.getStorageSync('suxingFilter') || {});
		        data = { ...data, ...sf };
		      }
		      this.getTiezi_api(data, false);
		    }
		  },
		  // 监听海报高度变化：当高度变为有效真实值时，更新缓存（避免刷新后仍用旧的112px）
		  swiperHeight(h) {
		    try {
		      const si = uni.getSystemInfoSync();
		      const ww = si && si.windowWidth ? si.windowWidth : 375;
		      const isPc = !!this.pc;
		      // 计算平台估算值，用于区分真实值与估算值
		      let est = isPc ? 250 : Math.floor(ww * 0.68);
		      // #ifdef H5
		      est = isPc ? 250 : Math.floor(ww * 0.65);
		      // #endif
		      // 仅当高度有效且与估算值差异>2px时才写入缓存，避免估算值污染
		      if (Number(h) > 0 && Math.abs(Number(h) - est) > 2) {
		        uni.setStorageSync('haibaoHeight:last', Number(h));
		      }
		    } catch (e) {}
		  }
		
		},
		onReachBottom() {
  			// 返回首页短时间内禁用触底自动加载，避免瞬间触底误触发
  			if (this.disableLoadMoreUntil && Date.now() < this.disableLoadMoreUntil) return;
  			// 页面触底统一走 loadMoreData，避免与滚动监听并发触发导致页码不稳定
  			if (this.isLoading || this.noMoreData || this.isNavigating || this.isSwitchingCategory) return;
  			// 视为用户已经主动滚动，允许加载更多
  			this.hasUserScrolled = true;
  			this.loadMoreData();
  		},
		// 下拉刷新：清理缓存并按当前筛选重新加载首屏
		onPullDownRefresh() {
			// 刷新时重新计算并更新海报高度缓存（先行一次）
			try { this.getGao(); } catch (e) {}
			try { this.clearListCache(); } catch (e) {}
			this.tiezi_list = [];
			this.currentPage = 1;
			this.noMoreData = false;
			// 轻延迟后再计算一次，确保首屏内容和图片加载后高度更准确
			setTimeout(() => { try { this.getGao(); } catch (e) {} }, 500);
			const cid = (this.activeIndex && this.activeIndex.id >= 0) ? this.activeIndex.id : 0;
			const source = this.activeFilterSource || uni.getStorageSync('activeFilterSource') || '';
			let data = { categories: cid, page: 1 };
			if (source === 'suxing') {
				const sf = this.suxingFilter && Object.keys(this.suxingFilter).length ? this.suxingFilter : (uni.getStorageSync('suxingFilter') || {});
				data = { ...data, ...sf };
			} else {
				const leixing_id = uni.getStorageSync('leixing_id');
				if (leixing_id == 1) data.tuijian = 1;
				if (leixing_id == 2) data.jinghua = 1;
				if (leixing_id == 3) data.remen = 1;
				if (leixing_id == 4) data.reping = 1;
				if (leixing_id == 5) data.guanzhu = 1;
				if (leixing_id == 7) data.shoucang = 1;
				if (leixing_id == 8) data.dianzan = 1;
				if (leixing_id == 9) data.pinglun = 1;
				if (leixing_id == 10) data.lishi = 1;
			}
			this.getTiezi_api(data, false);
			try { uni.stopPullDownRefresh(); } catch (e) {}
		},

		methods: {
			// 计算出tab的高度
			getTabHeight() {
				try {
					// 获取系统信息
					let systemInfo = uni.getSystemInfoSync();
					let tabBarHeight = 0;
					
					// #ifdef APP-PLUS || MP-WEIXIN
					// 原生App和微信小程序：通过安全区域计算tabbar高度
					if (systemInfo.safeArea && systemInfo.screenHeight) {
						tabBarHeight = systemInfo.screenHeight - systemInfo.safeArea.bottom;
						console.log('通过安全区域计算tabBarHeight:', tabBarHeight);
					}
					// #endif
					
					// #ifdef H5
					// H5平台：使用默认值或尝试获取
					if (!tabBarHeight) {
						// 检查是否有底部tabbar元素
						const tabBar = document.querySelector('.uni-tabbar');
						if (tabBar) {
							tabBarHeight = tabBar.offsetHeight;
							//console.log('H5平台获取tabBarHeight:', tabBarHeight);
						} else {
							// 默认值
							tabBarHeight = 50;
							//console.log('H5平台使用默认tabBarHeight:', tabBarHeight);
						}
					}
					// #endif
					
					// 确保tabBarHeight有值
					if (!tabBarHeight) {
						tabBarHeight = 50; // 设置默认值
						//console.log('使用默认tabBarHeight:', tabBarHeight);
					}
					
					// 保存tabBar高度供其他地方使用
					this.tabHeight = Math.floor(tabBarHeight);
					//console.log('最终tabHeight设置为:', this.tabHeight);
					
					// 可选：存储到全局或缓存中
					try {
						uni.setStorageSync('tabBarHeight', this.tabHeight);
					} catch (e) {
						//console.log('存储tabBarHeight失败:', e);
					}
				} catch (e) {
					//console.error('获取tabBar高度时出错:', e);
					// 设置默认值作为后备
					this.tabHeight = 50;
				}
			},
			// 让海报高度跟随浏览器大小变化，并优先使用真实测量值（仅 H5 调用）
			updateHaibaoLastOnResize() {
				try {
					// #ifdef H5
					// PC 端始终固定为 250
					const isPc = this.$store && this.$store.state && this.$store.state.kuan && this.$store.state.kuan.pc;
					if (isPc) {
						this.swiperHeight = 250;
						try { uni.setStorageSync('haibaoHeight:last', 250); } catch (e1) {}
						return;
					}
					// 非 PC 端：防抖后进行真实测量
					if (this.resizeMeasureTimer) {
						clearTimeout(this.resizeMeasureTimer);
					}
					this.resizeMeasureTimer = setTimeout(() => {
						this.$nextTick(() => {
							try {
								const q = uni.createSelectorQuery().in(this);
										q.select('#haibao-swiper').boundingClientRect(box => {
											const si = uni.getSystemInfoSync();
											const ww = si && si.windowWidth ? si.windowWidth : (typeof window !== 'undefined' ? window.innerWidth : 375);
											const containerW = box && box.width ? Math.floor(box.width) : Math.floor(ww);
											const ar = (this.lastHaibaoAspectRatio && Number(this.lastHaibaoAspectRatio) > 0) ? Number(this.lastHaibaoAspectRatio) : null;
											const est = Math.floor(containerW * 0.65);
											const minReal = Math.floor(containerW * 0.45);
											if (ar) {
												const targetH = Math.floor(containerW * ar) + 2;
												this.swiperHeight = targetH;
												if (targetH > minReal && Math.abs(targetH - est) > 2) {
													uni.setStorageSync('haibaoHeight:last', targetH);
												}
											} else {
												// 无已知宽高比：暂用估算，不写入缓存
												this.swiperHeight = est;
											}
										}).exec();
							} catch (err) {}
						});
					}, 200);
					// #endif
				} catch (e) {}
			},
			// 新增：首次进入兜底拉取（优先用推荐，若仍为空再用基础筛选）
			tryFirstLoadFallback(baseData) {
				try {
					const base = { categories: (this.activeIndex && this.activeIndex.id >= 0) ? this.activeIndex.id : 0, page: 1, gongkai: 1, syxs: 1, ...(baseData || {}) };
					const hasKeyFilter = !!(base.tuijian || base.jinghua || base.remen || base.reping || base.guanzhu || base.shoucang || base.dianzan || base.pinglun || base.lishi);
					if (hasKeyFilter) return;
					// 第一次尝试用推荐作为兜底
					this.getTiezi_api({ ...base, tuijian: 1 }, false);
					setTimeout(() => {
						if (!Array.isArray(this.tiezi_list) || this.tiezi_list.length === 0) {
							this.getTiezi_api(base, false);
						}
					}, 800);
				} catch (e) {}
			},
			// 新增：点击空状态刷新首屏
			refreshFirstScreen() {
				try { this.clearListCache(); } catch (e) {}
				this.tiezi_list = [];
				this.currentPage = 1;
				this.noMoreData = false;
				const cid = (this.activeIndex && this.activeIndex.id >= 0) ? this.activeIndex.id : 0;
				const source = this.activeFilterSource || uni.getStorageSync('activeFilterSource') || '';
				let data = { categories: cid, page: 1, gongkai: 1, syxs: 1 };
				if (source === 'suxing') {
					const sf = this.suxingFilter && Object.keys(this.suxingFilter).length ? this.suxingFilter : (uni.getStorageSync('suxingFilter') || {});
					data = { ...data, ...sf };
				} else {
					const leixing_id = uni.getStorageSync('leixing_id');
					if (leixing_id == 1) data.tuijian = 1;
					if (leixing_id == 2) data.jinghua = 1;
					if (leixing_id == 3) data.remen = 1;
					if (leixing_id == 4) data.reping = 1;
					if (leixing_id == 5) data.guanzhu = 1;
					if (leixing_id == 7) data.shoucang = 1;
					if (leixing_id == 8) data.dianzan = 1;
					if (leixing_id == 9) data.pinglun = 1;
					if (leixing_id == 10) data.lishi = 1;
				}
				this.getTiezi_api(data, false);
			},
			// 新增：根据标题后缀选择图标
            getTitleIcon(title) {
                const t = (title || '').toLowerCase();
                // 提取最后一个点后的后缀
                const dotIdx = t.lastIndexOf('.');
                const ext = dotIdx !== -1 ? t.slice(dotIdx + 1) : '';
                if (ext === 'pdf' || t.includes('.pdf')) return '/static/img/pdf.png';
                if (ext === 'txt' || t.includes('.txt')) return '/static/img/txt.png';
				if (ext === 'pptx' || t.includes('.txt')) return '/static/img/ppt.png';
                if (ext === 'rar' || ext === 'zrp' || ext === 'gz' || t.includes('.rar') || t.includes('.zrp') || t.includes('.gz')) return '/static/img/rar.png';
                return '/static/img/w.png';
            },

			// 清理帖子列表的缓存（内存与本地存储）
			clearListCache() {
				try {
					// 清空内存缓存
					this.tieziCache = {};
					// 同步重置筛选状态（内存）
					this.activeFilterSource = '';
					this.suxingFilter = {};
					// 清理本地存储中以 'tieziCache:' 开头的键
					const info = uni.getStorageInfoSync();
					const keys = info && info.keys ? info.keys : [];
					keys.forEach(k => {
						if (k && typeof k === 'string' && k.indexOf('tieziCache:') === 0) {
							try { uni.removeStorageSync(k); } catch (err) {}
						}
					});
					// 刷新后同步清理 leixing_id、activeFilterSource、suxingFilter
					try { uni.removeStorageSync('leixing_id'); } catch (err) {}
					try { uni.removeStorageSync('activeFilterSource'); } catch (err) {}
					try { uni.removeStorageSync('suxingFilter'); } catch (err) {}
				} catch (e) {}
			},
			// 设置音频引用
			setAudioRef(el, index) {
				if (!this.audioPlayers) {
					this.audioPlayers = {};
				}
				if (el) {
					this.audioPlayers[index] = el;
				}
			},
			// 设置视频引用
			setVideoRef(el, index) {
				if (!this.videoPlayers) {
					this.videoPlayers = {};
				}
				if (el) {
					this.videoPlayers[index] = el;
				}
			},
			getGao() {
			
				/*#ifdef APP-PLUS || H5*/
				var self = this; 
				setTimeout(function () {
					uni.getSystemInfo({
						success: (res) => {
							let info = uni.createSelectorQuery().in(self);
									info.select(".swiper-item").boundingClientRect(data => {
										// 安全判断，避免首次进入时元素未渲染导致 data 为 null
										const height = data && data.height ? Math.floor(data.height) : 0;
																								if (height > 0) {
																									self.swiperHeight = height;
																									// 仅当测得高度不是“估算回退值”时才写入缓存，避免 243px 等估算值污染
																									try {
																										let est = 0;
																										try {
																											const si2 = uni.getSystemInfoSync();
																											const ww2 = si2 && si2.windowWidth ? si2.windowWidth : 375;
																											if (!self.pc) {
																												// #ifdef H5
																											est = Math.floor(ww2 * 0.65);
																											// #endif
																											// #ifdef MP-WEIXIN
																											est = Math.floor(ww2 * 0.68);
																											// #endif
																											// #ifndef H5 || MP-WEIXIN
																											est = Math.floor(ww2 * 0.6);
																											// #endif
																										} else {
																											est = 250;
																										}
																									} catch (e2) {}
																										const diff = Math.abs(height - est);
																										if (diff > 2) {
																											uni.setStorageSync('haibaoHeight:last', self.swiperHeight);
																										}
																									} catch (err) {}
																							} else {
																									// 若已有有效高度（缓存或此前计算），则保留，不用比例估算覆盖
																									if (self.swiperHeight && Number(self.swiperHeight) > 0) {
																							// 保留现有高度，避免回首页被估算值覆盖
																						} else {
																							// 改进回退：根据屏幕宽度估算高度，避免返回后读不到元素高度
																							try {
																								const si = uni.getSystemInfoSync();
																								const ww = si && si.windowWidth ? si.windowWidth : 375;
																								if (!self.pc) {
																															// #ifdef H5
																														self.swiperHeight = Math.floor(ww * 0.65);
																															// #endif
																															// #ifdef MP-WEIXIN
																														self.swiperHeight = Math.floor(ww * 0.68);
																															// #endif
																															// #ifndef H5 || MP-WEIXIN
																														self.swiperHeight = Math.floor(ww * 0.6);
																															// #endif
																								} else {
																									self.swiperHeight = 250;
																								}
																								/* 保留估算高度用于当前渲染，但不写入 last，避免下次返回使用估算值 */
																							} catch (e) {
																								// 最终回退
																								self.swiperHeight = self.swiperHeight && self.swiperHeight > 0 ? self.swiperHeight : 250;
																						}
																					}
																				}
																								
									// 刷新后根据最新计算结果更新缓存高度（避免旧值）
	    try {
	        const siC = uni.getSystemInfoSync();
	        const wwC = siC && siC.windowWidth ? siC.windowWidth : 375;
	        let estH = this.pc ? 250 : (this.isH5 ? Math.floor(wwC * 0.65) : Math.floor(wwC * 0.68));
	        const h = Number(this.swiperHeight || 0);
	        const minReal = this.pc ? 120 : Math.floor(wwC * 0.45);
	        // 仅当高度充足且明显不同于估算值时才更新缓存，避免写入估算或过小高度
	        if (h > minReal && Math.abs(h - estH) > 2) {
	            uni.setStorageSync('haibaoHeight:last', h);
	        }
	    } catch (err) {}
	    }).exec();
						}
					});
				}, 300) 
				/*#endif*/
				/*#ifdef MP-WEIXIN*/
				var self = this; 
				setTimeout(function () {
					uni.getSystemInfo({
						success: (res) => {
							let info = uni.createSelectorQuery();
							info.select(".swiper-item").boundingClientRect(data => {
								//console.log("高度：",data);
								//self.swiperheight = data.height;
							}).exec();
						}
					});
				}, 500)
			
				/*#endif*/
			
				
			},
			//获取页面所有的音频 id=yinpin_ 元素
			getAllAudioElements() {
				try {
					// 检查 document 是否存在（兼容不同环境）
					if (typeof document === 'undefined') {
						//console.warn('当前环境不支持 document 对象');
						return [];
					}
					
					// 使用标准属性选择器获取所有 id 以 'yinpin_' 开头的元素
					const audioElements = document.querySelectorAll('[id^="yinpin_"]');
					const audioArray = Array.from(audioElements);
					//console.log('获取到音频元素数量:', audioArray.length);
					
					// 返回数组格式便于后续操作
					return audioArray;
				} catch (e) {
					console.error('获取音频元素失败:', e);
					return [];
				}
			},
			
			// 处理滚动事件，关闭所有视频和不可见的音频，并实现滚动触底检测
			handleScroll() {
				// 首次进入且用户还未主动滚动时，禁止自动触发加载
				if (this.isFirstEnter && !this.hasUserScrolled) {
					return;
				}
				// 导航到帖子详情期间，禁止触发加载，防止返回后页码不稳定
				if (this.isNavigating || this.isSwitchingCategory) {
					return;
				}
				// 当列表为空时，不触发滚动加载，避免“无数据”场景下循环请求
				if (!Array.isArray(this.tiezi_list) || this.tiezi_list.length === 0) {
					return;
				}
				// 防御性处理，确保即使媒体关闭出错也不影响滚动触底检测
				try {
					this.closeAllVideos();
					this.closeAllAudios();
				} catch (e) {
					console.warn('媒体关闭异常，已忽略：', e);
				}
				
				// 移除滚动触底检测，仅通过onReachBottom触发加载下一页
			},
			// 用户滚动事件（仅用于标记用户已主动滚动）
			onScrollEvent(e) {
				this.hasUserScrolled = true;
				// 移除handleScroll调用，仅通过onReachBottom触发加载下一页
			},
			
			// 加载更多数据
			loadMoreData() {
				// 返回首页后短时间禁用触底加载，避免瞬间触底误触发
				if (this.disableLoadMoreUntil && Date.now() < this.disableLoadMoreUntil) return;
				// 首次进入且用户还未主动滚动时，禁止自动触发加载
				if (this.isFirstEnter && !this.hasUserScrolled) return;
				// 导航到帖子详情期间，禁止触发加载，防止返回后页码不稳定
				if (this.isNavigating) return;
				// 避免并发重复加载
				if (this.isLoading || this.noMoreData) return;
				// 有 pending 的滚动防抖定时器时先清理，避免 100ms 后再次触发
				if (this.scrollTimeout) {
					clearTimeout(this.scrollTimeout);
					this.scrollTimeout = null;
				}
				this.isLoading = true;
				// 显示加载提示
				/*uni.showToast({
					title: '正在加载下一页...',
					icon: 'none',
					duration: 1500
				});*/
				this.currentPage++;
				
				// 获取当前激活的分类ID
				const currentCategoryId = this.activeIndex.id >= 0 ? this.activeIndex.id : 0;
				
				// 构建分页参数（互斥选择：根据 activeFilterSource 决定只用一种筛选）
				const source = this.activeFilterSource || uni.getStorageSync('activeFilterSource') || '';
				let data = {
					page: this.currentPage,
					categories: currentCategoryId
				};
				if (source === 'suxing') {
					// 仅使用属性筛选
					const sf = this.suxingFilter && Object.keys(this.suxingFilter).length ? this.suxingFilter : (uni.getStorageSync('suxingFilter') || {});
					data = { ...data, ...sf };
				} else if (source === 'leixing') {
					// 仅使用左侧导航筛选（优先读取内存 index_suxing，回退本地存储；并补齐 8/9/10）
					const leixing_id = (typeof this.index_suxing === 'number') ? this.index_suxing : uni.getStorageSync('leixing_id');
					if (leixing_id == 1) data.tuijian = 1;
					if (leixing_id == 2) data.jinghua = 1;
					if (leixing_id == 3) data.remen = 1;
					if (leixing_id == 4) data.reping = 1;
					if (leixing_id == 5) data.guanzhu = 1;
					if (leixing_id == 7) data.shoucang = 1;
					if (leixing_id == 8) data.dianzan = 1;
					if (leixing_id == 9) data.pinglun = 1;
					if (leixing_id == 10) data.lishi = 1;
				} else {
					// 回退策略：优先使用当前的 suxingFilter，否则使用 leixing_id（优先读取内存 index_suxing，补齐 8/9/10）
					if (this.suxingFilter && Object.keys(this.suxingFilter).length) {
						data = { ...data, ...this.suxingFilter };
					} else {
						const leixing_id = (typeof this.index_suxing === 'number') ? this.index_suxing : uni.getStorageSync('leixing_id');
						if (leixing_id == 1) data.tuijian = 1;
						if (leixing_id == 2) data.jinghua = 1;
						if (leixing_id == 3) data.remen = 1;
						if (leixing_id == 4) data.reping = 1;
						if (leixing_id == 5) data.guanzhu = 1;
						if (leixing_id == 7) data.shoucang = 1;
						if (leixing_id == 8) data.dianzan = 1;
						if (leixing_id == 9) data.pinglun = 1;
						if (leixing_id == 10) data.lishi = 1;
					}
				}
				
				this.getTiezi_api(data, true);
			},

			// 关闭页面上所有的视频
			closeAllVideos() {
				// 获取所有视频元素
				const videoElements = document.querySelectorAll('video');
				if (videoElements.length > 0) {
					videoElements.forEach(video => {
						if (!video.paused) {
							try {
								video.pause();
							} catch (e) {
								console.log('视频暂停失败:', e);
							}
						}
					});
				}
			},
			
			// 音频开始播放时的处理
			onAudioPlay(currentIndex) {
				// 懒加载：仅在用户点击播放时设置音频src
				const tie = Array.isArray(this.tiezi_list) ? this.tiezi_list[currentIndex] : null;
				const realSrc = tie && tie.yinpin && tie.yinpin[0] ? tie.yinpin[0] : '';
				if (!this.audioSrcMap[currentIndex]) {
					this.audioSrcMap[currentIndex] = realSrc;
				}
				// 先关闭所有其他音频，避免并发播放
				this.closeAllAudios();
				// 确保src已设置后再尝试播放当前音频
				setTimeout(() => {
					const currentAudio = this.audioPlayers && this.audioPlayers[currentIndex];
					if (currentAudio && typeof currentAudio.play === 'function') {
						try { currentAudio.play(); } catch (e) { console.log('重新播放当前音频失败:', e); }
					}
				}, 100);
			},
			
			// 视频点击后懒加载并播放
			onVideoClick(currentIndex) {
				const tie = Array.isArray(this.tiezi_list) ? this.tiezi_list[currentIndex] : null;
				const realSrc = tie && tie.shipin && tie.shipin[0] && tie.shipin[0].shipin ? tie.shipin[0].shipin : '';
				if (!this.videoSrcMap[currentIndex]) {
					this.videoSrcMap[currentIndex] = realSrc;
				}
				// 暂停其他视频，避免并发播放
				this.closeAllVideos();
				// 确保src已设置后再尝试播放当前视频
				setTimeout(() => {
					const currentVideo = this.videoPlayers && this.videoPlayers[currentIndex];
					if (currentVideo && typeof currentVideo.play === 'function') {
						try { currentVideo.play(); } catch (e) { console.log('重新播放当前视频失败:', e); }
					}
				}, 100);
			},
			
			// 关闭页面上所有的音频
			closeAllAudios() {
				try {
					// 优先使用audioPlayers中的引用（Vue组件方式）
					if (this.audioPlayers && typeof this.audioPlayers === 'object') {
						Object.keys(this.audioPlayers).forEach(key => {
							const audioPlayer = this.audioPlayers[key];
							if (audioPlayer) {
								// 尝试使用Vue组件方式调用pause方法
								if (typeof audioPlayer.pause === 'function') {
									try {
										audioPlayer.pause();
										//console.log('通过组件引用成功暂停音频');
									} catch (e) {
										//console.log('组件引用暂停失败:', e);
									}
								}
							}
						});
					}
					
					// 回退方案：使用getAllAudioElements获取所有音频元素
					const audioElements = this.getAllAudioElements();
					if (audioElements.length > 0) {
						audioElements.forEach(audioElement => {
							// 尝试多种方式停止音频
							if (audioElement) {
								// 1. 尝试直接调用pause方法
								if (typeof audioElement.pause === 'function') {
									try {
										audioElement.pause();
									} catch (e) {
										console.log('音频直接暂停失败:', e);
									}
								}
								
								// 2. 检查是否有内部的audioContext并关闭
								if (audioElement.audioContext) {
									try {
										audioElement.audioContext.close();
									} catch (e) {
										console.log('关闭audioContext失败:', e);
									}
								}
								// 3. 重置音频.currentTime
								if (typeof audioElement.currentTime !== 'undefined') {
									try {
										audioElement.currentTime = 0;
									} catch (e) {
										console.log('重置音频时间失败:', e);
									}
								}
							}
						});
					}
				} catch (e) {
					console.error('关闭音频失败:', e);
				}
			},
			// 关闭页面上所有的视频
			closeAllVideos() {
				try {
					if (this.videoPlayers && typeof this.videoPlayers === 'object') {
						Object.keys(this.videoPlayers).forEach(key => {
							const video = this.videoPlayers[key];
							if (video) {
								if (typeof video.pause === 'function') {
									try { video.pause(); } catch (e) {}
								}
								if (typeof video.currentTime !== 'undefined') {
									try { video.currentTime = 0; } catch (e) {}
								}
							}
						});
					}
				} catch (e) {
					console.error('关闭视频失败:', e);
				}
			},
			//左边导航
			leixing_id(e){
				// 若正在加载或正在切换，忽略点击，避免并发重复请求
				if (this.isLoading || this.isSwitchingCategory) {
					return;
				}
				// 若重复点击同一个导航，直接复用缓存并返回，避免二次加载
				const prev = this.index_suxing;
				if (e === prev) {
					const cid = (this.activeIndex && this.activeIndex.id >= 0) ? this.activeIndex.id : 0;
					const cacheKey = `cid:${cid}|lx:${e}|sx:${this.lastSuxingId ?? 0}`;
					let cache = this.tieziCache && this.tieziCache[cacheKey];
					if (!cache) {
						try { const sc = uni.getStorageSync('tieziCache:'+cacheKey); if (sc && typeof sc === 'object') cache = sc; } catch (err) {}
					}
					if (cache) {
					this.tiezi_list = cache.list;
					this.currentPage = cache.currentPage || 1;
					this.noMoreData = !!cache.noMoreData;
					this.suxingFilter = cache.suxingFilter || this.suxingFilter;
				}
				// 复用缓存后释放点击锁
				this.tabClickLock = false;
				return;
				}
				this.index_suxing = e; // 首页id属性
				//console.log('leixing事件，参数e:', e, '类型:', typeof e);
				// 设置筛选来源为左侧导航，并清空属性筛选，确保互斥
				this.activeFilterSource = 'leixing';
				this.suxingFilter = {};
				this.lastSuxingId = null; // 重置属性筛选索引，避免缓存键混入之前的属性id
				try { uni.setStorageSync('activeFilterSource', 'leixing'); uni.removeStorageSync('suxingFilter'); } catch (err) {}

				// 优先命中缓存：同一(分类cid + 左侧导航lx + 属性sx)组合，直接复用列表与分页状态，避免重复请求
				const cid = (this.activeIndex && this.activeIndex.id >= 0) ? this.activeIndex.id : 0;
				const cacheKey = `cid:${cid}|lx:${e}|sx:${this.lastSuxingId ?? 0}`;
				let cache = this.tieziCache && this.tieziCache[cacheKey];
				if (!cache) {
					try { const sc = uni.getStorageSync('tieziCache:'+cacheKey); if (sc && typeof sc === 'object') cache = sc; } catch (err) {}
				}
				if (cache && !this.isLoading) {
					this.tiezi_list = cache.list;
					this.currentPage = cache.currentPage || 1;
					this.noMoreData = !!cache.noMoreData;
					// 保持现有筛选参数（suxingFilter）不变即可
					return;
				}

				// 先初始化data对象，避免未定义错误
				let data = {};
				// 如果传入的参数e等于1，则设置tuijian属性为1（推荐标识）
				//推荐
				if (e == 1) {
					data.tuijian = 1;
					//console.log('设置data.tuijian = 1');
				}
				//精华
				if (e == 2) {
					data.jinghua = 1;
					//console.log('设置data.jinghua = 2');
				}
				//热门
				if(e == 3){
					data.remen = 1;
				}
				//热评
				if(e == 4){
					data.reping = 1;
				}
				//关注
				if(e == 5){
					data.guanzhu = 1;
				}
				//收藏
				if(e == 7){
					data.shoucang = 1;
				}
				//点赞
				if(e == 8){
					data.dianzan = 1;
				}
				//评论
				if(e == 9){
					data.pinglun = 1;
				}
				//历史
				if(e == 10){
					data.lishi = 1;
				}
				//console.log('准备调用getTiezi_api，data:', data);
				// 用户主动切换分类时，重置滚动状态与分页，允许刷新覆盖列表
				this.hasUserScrolled = false;
				this.currentPage = 1;
				this.noMoreData = false;
				// 持久化当前左侧导航，供分页时使用
				try { uni.setStorageSync('leixing_id', e); } catch (err) {}
				// 不清空列表，避免高度骤减导致页面跳动
				this.isSwitchingCategory = true;
				// 在调用接口前提前标记加载中，避免 uv-tabs 同步二次触发导致重复请求
				this.isLoading = true;
				this.getTiezi_api(data, false);
				// 防御：300ms 后自动释放点击锁，避免极端情况下锁未释放
				setTimeout(() => { this.tabClickLock = false; }, 300);
			},
 			click_suxing(e){
				// 兼容 uv-tabs 不同返回格式：可能只返回 { index }，也可能包含 { id, name }
				const prevIdx = this.tie_suxing;
				const idx = typeof e === 'number' ? e : (e && typeof e.index === 'number' ? e.index : 0);
				this.tie_suxing = idx;
				// 点击锁：防止 uv-tabs 在同一次交互内多次触发 click 事件
				if (this.tabClickLock) {
					return;
				}
				this.tabClickLock = true;
				// 根据索引从 tabs 列表中获取当前项
				const item = Array.isArray(this.list_shuxing) ? this.list_shuxing[idx] : null;
				const id = (item && typeof item.id === 'number') ? item.id : (e && typeof e.id === 'number' ? e.id : null);
				const name = item && item.name ? item.name : (e && e.name ? e.name : '');
				// 正在加载或切换期间，忽略点击，避免并发重复请求
				if (this.isLoading || this.isSwitchingCategory) {
					return;
				}
				// 如果点击的是同一个属性分类，则直接复用缓存并返回，避免二次加载
				if (id === this.lastSuxingId) {
					const cid = (this.activeIndex && this.activeIndex.id >= 0) ? this.activeIndex.id : 0;
					const cacheKey = `cid:${cid}|lx:${this.index_suxing}|sx:${id ?? 0}`;
					let cache = this.tieziCache && this.tieziCache[cacheKey];
					if (!cache) {
						try { const sc = uni.getStorageSync('tieziCache:'+cacheKey); if (sc && typeof sc === 'object') cache = sc; } catch (err) {}
					}
					if (cache) {
						this.tiezi_list = cache.list;
						this.currentPage = cache.currentPage || 1;
						this.noMoreData = !!cache.noMoreData;
						this.suxingFilter = cache.suxingFilter || this.suxingFilter;
					}
					return;
				}
				// 记录最新选择的分类id
				this.lastSuxingId = id;
				// 优先命中缓存：同一(分类cid + 左侧导航lx + 属性sx)组合，直接复用列表与分页状态，避免重复请求
				const cid = (this.activeIndex && this.activeIndex.id >= 0) ? this.activeIndex.id : 0;
				const cacheKey = `cid:${cid}|lx:${this.index_suxing}|sx:${id ?? 0}`;
				let cache = this.tieziCache && this.tieziCache[cacheKey];
				if (!cache) {
					try { const sc = uni.getStorageSync('tieziCache:'+cacheKey); if (sc && typeof sc === 'object') cache = sc; } catch (err) {}
				}
				if (cache && !this.isLoading) {
					this.tiezi_list = cache.list;
					this.currentPage = cache.currentPage || 1;
					this.noMoreData = !!cache.noMoreData;
					this.suxingFilter = cache.suxingFilter || this.suxingFilter;
					// 复用缓存后释放点击锁
					this.tabClickLock = false;
					return;
				}
				let data = {};
				const is = (str) => name === str;
				// 映射分类到接口筛选字段
				if (id === 0 || is('全部')) {
					// 全部：不设置筛选条件
				} else if (id === 1 || is('图文')) {
					data.tupianzhi = 1;
				} else if (id === 2 || is('视频')) {
					data.shipinzhi = 1;
				} else if (id === 3 || is('音频')) {
					data.yinpinzhi = 1;
				} else if (id === 4 || is('附件')) {
					data.fujianzhi = 1;
				} else if (id === 5 || is('付费文章')) {
					data.fufeizhi = 1;
				}
				// 将当前属性筛选持久化，供分页加载复用
				this.suxingFilter = { ...data };
				// 设置筛选来源为属性，并持久化，确保与左侧导航互斥
				this.activeFilterSource = 'suxing';
				try { uni.setStorageSync('activeFilterSource', 'suxing'); uni.setStorageSync('suxingFilter', this.suxingFilter); } catch (err) {}
				// 用户主动切换属性时，重置滚动状态与分页，允许刷新覆盖列表
				this.hasUserScrolled = false;
				this.currentPage = 1;
				this.noMoreData = false;
				// 不清空列表，避免高度骤减导致页面跳动
				this.isSwitchingCategory = true;
				// 在调用接口前提前标记加载中，避免 uv-tabs 同步二次触发导致重复请求
				this.isLoading = true;
				this.getTiezi_api(data, false);
				// 防御：300ms 后自动释放点击锁，避免极端情况下锁未释放
				setTimeout(() => { this.tabClickLock = false; }, 300);
			},
			//图片
			onImageLoad(e, index) {
				// 获取系统信息
				const systemInfo = uni.getSystemInfoSync();
				// 计算可用宽度
				const windowWidth = systemInfo.windowWidth;
				
				if(this.pc){
					var gao = 30;
				} else {
					var gao = 0;
				}

				this.$nextTick(() => {
        		    const query = uni.createSelectorQuery().in(this);
        		    query.select('#tupian-'+index).boundingClientRect(data => {
        		        if (data && data.width > 0 && data.height > 0) {
        		            this.$set(this.haibao_data[index], 'imageSize', {
        		                width: data.width,
        		                height: data.height + gao
        		            });
        		            
        		            // 动态计算swiperHeight，确保各环境下图片完整显示且无上下空白
        		            // #ifdef H5
                    if (!this.pc) {
                        // 获取图片原始宽高比（增加空值判断，避免 e.detail 为 null/undefined）
                        const imgWidth = e && e.detail ? e.detail.width : 0;
                        const imgHeight = e && e.detail ? e.detail.height : 0;
                        if (imgWidth > 0 && imgHeight > 0) {
                            const aspectRatio = imgHeight / imgWidth;
                            // 记录当前图片宽高比，供窗口缩放时复用
                            this.$set(this.haibao_data[index], 'aspectRatio', aspectRatio);
                            this.lastHaibaoAspectRatio = aspectRatio;
                            // 基于实际容器宽度和图片宽高比精确计算高度
                            const containerWidth = data && data.width ? data.width : windowWidth;
                            const calculatedHeight = containerWidth * aspectRatio;
                            // 添加少许余量以确保完全显示
                            this.swiperHeight = Math.floor(calculatedHeight) + 2;
                        } else {
                            // 尝试使用原生 Image 预载获取真实宽高（H5环境）
                            // 若 e.detail 无法提供尺寸，则使用 item.img 的 naturalWidth/Height 计算
                            try {
                                const item = this.haibao_data && this.haibao_data[index] ? this.haibao_data[index] : null;
                                const src = item && item.img ? item.img : '';
                                if (src) {
                                    const containerWidth = data && data.width ? data.width : windowWidth;
                                    const tmp = new Image();
                                    tmp.onload = () => {
                                        const nw = tmp.naturalWidth || tmp.width || 0;
                                        const nh = tmp.naturalHeight || tmp.height || 0;
                                        if (nw > 0 && nh > 0) {
                                            const aspectRatio = nh / nw;
                                            // 记录当前图片宽高比，供窗口缩放时复用
                                            this.$set(this.haibao_data[index], 'aspectRatio', aspectRatio);
                                            this.lastHaibaoAspectRatio = aspectRatio;
                                            const calculatedHeight = containerWidth * aspectRatio;
                                            this.swiperHeight = Math.floor(calculatedHeight) + 2;
                                        } else if (data && data.height > 0) {
                                            // 回退：使用实际渲染高度
                                            this.swiperHeight = Math.floor(data.height) + 2;
                                        } else {
                                            // 最终回退：使用默认值
                                            this.swiperHeight = 250;
                                        }
                                    };
                                    tmp.onerror = () => {
                                        // 加载失败时的回退
                                        if (data && data.height > 0) {
                                            this.swiperHeight = Math.floor(data.height) + 2;
                                        } else {
                                            this.swiperHeight = 250;
                                        }
                                    };
                                    tmp.src = src;
                                } else if (data && data.height > 0) {
                                    // 回退：使用实际渲染高度
                                    this.swiperHeight = Math.floor(data.height) + 2;
                                } else {
                                    // 最终回退：使用默认值
                                    this.swiperHeight = 250;
                                }
                            } catch (err) {
                                // 异常回退
                                if (data && data.height > 0) {
                                    this.swiperHeight = Math.floor(data.height) + 2;
                                } else {
                                    this.swiperHeight = 250;
                                }
                            }
                        }
                    }
                    // #endif
        		            
        		            // #ifdef MP-WEIXIN
                    // 微信小程序环境下的特殊处理
                    if (!this.pc) {
                        // 获取图片原始宽高比（增加空值判断，避免 e.detail 为 null/undefined）
                        const imgWidth = e && e.detail ? e.detail.width : 0;
                        const imgHeight = e && e.detail ? e.detail.height : 0;
                        if (imgWidth > 0 && imgHeight > 0) {
                            const aspectRatio = imgHeight / imgWidth;
                            // 记录当前图片宽高比，供窗口缩放时复用
                            this.$set(this.haibao_data[index], 'aspectRatio', aspectRatio);
                            this.lastHaibaoAspectRatio = aspectRatio;
                            // 微信小程序环境下，考虑到小程序的渲染机制，使用稍大的系数
                            const containerWidth = data && data.width ? data.width : windowWidth;
                            const calculatedHeight = containerWidth * aspectRatio;
                            // 设置合适的高度，确保小程序中图片完整显示
                            this.swiperHeight = Math.floor(calculatedHeight) + 4;
                        } else if (data && data.height > 0) {
                            // 回退：使用实际渲染高度
                            this.swiperHeight = Math.floor(data.height) + 4;
                        } else {
                            // 最终回退：使用默认值
                            this.swiperHeight = 250;
                        }
                    }
                    // #endif
        		            
							//console.log('图片尺寸:', this.haibao_data[index].imageSize);
        		        } else {
        		            //console.warn(`图片${index}尺寸获取失败`);
        		            this.$set(this.haibao_data[index], 'imageSize', {
        		                width: 300,
        		                height: 200
        		            });
        		        }
        		    }).exec();
        		});

    		},
			onSwiperChange(e) {
				try {
					const idx = e && e.detail ? e.detail.current : 0;
					this.activeHaibaoIndex = idx;
					const item = this.haibao_data && this.haibao_data[idx] ? this.haibao_data[idx] : null;
					if (item && item.aspectRatio && Number(item.aspectRatio) > 0) {
						this.lastHaibaoAspectRatio = Number(item.aspectRatio);
					}
				} catch (err) {}
			},
			getRightColWidth() {
				// 获取系统信息
				const systemInfo = uni.getSystemInfoSync();
        	    // 计算可用高度（可根据实际需求调整计算方式）
        	    const windowWidth = systemInfo.windowWidth;
				var d = this;

                this.$nextTick(() => {
				if(this.pc){
						d.gao = 20;
						d.kuan_shu = 7;
						// 如果已有有效高度（缓存或此前测量），则保留；否则使用默认 250
						if (!(d.swiperHeight && Number(d.swiperHeight) > 0)) {
							d.swiperHeight = 250;
						}
					} else {
						d.gao = 10;
						d.kuan_shu = 12;
						// 如果已有有效高度（缓存或此前测量），则保留；否则根据屏幕宽度估算
						if (!(d.swiperHeight && Number(d.swiperHeight) > 0)) {
							// 根据屏幕宽度计算适合的高度，保持16:9的黄金比例
							// 移动环境下使用uni.getSystemInfoSync获取屏幕宽度计算高度
							d.swiperHeight = Math.floor(windowWidth * 0.6); // 16:9比例约为0.5625，这里稍微调整为0.6以显示更完整图片
							// #ifdef H5
							// H5移动端环境下稍微增加高度，确保图片完全显示不被裁剪
							d.swiperHeight = Math.floor(windowWidth * 0.65);
							// #endif
							// #ifdef MP-WEIXIN
							// 微信小程序环境下，使用更高的系数以确保图片完整显示
							d.swiperHeight = Math.floor(windowWidth * 0.68);
							// #endif
						}
					}
				//console.log('窗口高度:', windowWidth);
                 const query = uni.createSelectorQuery().in(this);
                 query.select('#youbiankuan').boundingClientRect(rect => {
                   if (rect) {
                     /*this.rightColWidth = `${rect.width+20}px`;
                     console.log('右侧列宽度:', this.rightColWidth);*/
					 	this.rightColWidth = `${rect.width-80}px`;
                    	this.rightColLeft = `${rect.left}px`; // 计算左侧位置
                    	///console.log('右侧列位置:', this.rightColWidth);
                   }
                 }).exec();
               });
            },
			//首页
			shouye(){
				uni.navigateTo({
					url: '/pages/index/index',
					fail: (err) => {
						console.error('跳转失败:', err)
					}
				})
			},
			// ...其他方法保持不变...
			
			setLeftNavHeight() {
        	    // 获取系统信息
        	    const systemInfo = uni.getSystemInfoSync();
        	    // 计算可用高度（可根据实际需求调整计算方式）
        	    const windowHeight = systemInfo.windowHeight;
        	    const headerHeight = 70; // 头部高度估计值
        	    const calculatedHeight = windowHeight - headerHeight;
				 
        	    // 设置左边导航高度
        	    this.leftNavHeight = `${calculatedHeight}px`;
        	},
			// 获取中间宽度
			getKuanZhongjianWidth() {
				var d = this;
                this.$nextTick(() => {
                 const query = uni.createSelectorQuery().in(this);
                 query.select('.kuan_zhongjian').boundingClientRect(rect => {
                   if (rect) {
                     d.kuan_zhongjian_data = rect.width;
                     //console.log('中间宽度:', d.kuan_zhongjian_data);
                   } else {
                     //console.log('未获取到中间宽度，500ms后重试');
                     // 如果未获取到宽度，500ms后重试
                     setTimeout(() => {
                       d.getKuanZhongjianWidth();
                     }, 500);
                   }
                 }).exec();
               });
			},
			zhishi(id){
				console.log(id);
				try {
  				  uni.navigateTo({
  				    url: '/pages/zhishi/index?id='+id,
  				    fail: (err) => {
  				      console.error('跳转失败:', err)
  				    }
  				  })
  				} catch (e) {
  				  console.error('跳转异常:', e)
  				}
			},
			
			handleLoginSuccess() {
  			  this.$forceUpdate();
  			},
			
			
			// 海报接口
			haibao_api(){
				// 获取系统信息
				//const systemInfo = uni.getSystemInfoSync();
        	    // 计算可用高度（可根据实际需求调整计算方式）
        	    //const windowHeight = systemInfo.windowHeight;
				if(this.pc){
					var gao = 200;
					
				} else {
					var gao = 120;

				}

				var get_data = getRequest(Api.getHaibao());
				var res;
				get_data.then(duixin_data => {
					res = duixin_data;
					if(res.data.code) {
						// 转换时间戳为日期格式
						//var list = res.data ? res.data.data : {};
						/*var list = res.data && res.data.data ? res.data.data : [];
        				this.haibao_data = list;*/
						this.haibao_data = (res.data.data || []).map(item => ({
            			    ...item,
            			    imageSize: { width: 300, height: gao } // 添加默认尺寸
            			}));
                        // 数据就绪后，延迟重新计算海报高度，确保返回首页时高度正常
                        this.$nextTick(() => {
                          setTimeout(() => {
                            this.getGao();
                          }, 300);
                        });
						
					} else {
						uni.showToast({
							icon: 'none',
							title: '获取失败，请稍后重试'
						});
					}
				})
			},
			
			denglu_fabu(){
				
				var pc = this.$store.state.kuan.pc;
				if(pc){
					if(this.yidenglu == 0){
					    this.denglu_xianshi = 1;
				    } else {
					    this.denglu_xianshi = 0;	
				    }
				} else {
					if(this.yidenglu == 0){
					    this.denglu_xianshi_weibu = 1;	
					} else {
					    this.denglu_xianshi_weibu = 0;	
					}
					
				}
				
				//console.log('发布登录',this.denglu_xianshi);
				
			},
			denglu_close_get(){
				//console.log('关闭登录');
				this.denglu_xianshi_weibu = 0;
			},
			// 更新判断是否登录
			handleUpdateDengluxianshi(value) {
			  this.denglu_xianshi = value;
			  //console.log('关闭登录',this.denglu_xianshi);
			},
			// 帖子列表
			getTiezi_api(data,isLoadMore = false){

				if (!data) data = {};
				if (!data.page) data.page = 1;
				if (!data.categories) data.categories = 0;
				if (!data.search) data.search = '';
				var memberUid = this.$store.state.memberuid;
				var keycode = this.$store.state.keycode;
				if(memberUid){
					data.uid = memberUid;
				}
				if(keycode){
					data.keycode = keycode;
				}
				//if (!data.tuijian) data.tuijian = 1; // 推荐
				//if (!data.jinghua) data.jinghua = 1; // 精华
				//console.log('data.tuijian0000',data.tuijian);
				//console.log('data.jinghua1111',data.jinghua);
				data.gongkai = 1;
				data.syxs = 1;
				
				// 标记加载中，阻止并发触发加载更多导致首屏被覆盖
				this.isLoading = true;
				var get_data = getRequest(Api.getTiezi_list(data));
				var res;
				get_data.then(duixin_data => {
					res = duixin_data;
					if(res.data.code) {
						// 转换时间戳为日期格式
						var list = res.data? res.data.data : {};
						// 确保list是数组
						if (!Array.isArray(list)) list = [];
						if (isLoadMore) {
         				  // 加载更多时追加数据
         				  this.tiezi_list = [...this.tiezi_list, ...list];
         				  // 加载更多时，如果返回的数据小于 pageSize 或者为 0，则认为没有更多数据
         				  this.noMoreData = list.length < this.pageSize;
         				  // 若返回为空，回退页码，避免页码递增到不存在的页
         				  if (list.length === 0 && this.currentPage > 1) {
         				    this.currentPage--;
         				  }
                              // 同步缓存：保存当前(分类cid + 左侧导航lx + 属性sx)组合的列表与分页状态
                              {
                                const cid = (this.activeIndex && this.activeIndex.id >= 0) ? this.activeIndex.id : 0;
                                const sxId = (typeof this.lastSuxingId === 'number' && this.lastSuxingId >= 0) ? this.lastSuxingId : 0;
                                const lxId = (typeof this.index_suxing === 'number') ? this.index_suxing : 0;
                                const cacheKey = `cid:${cid}|lx:${lxId}|sx:${sxId}`;
                                this.tieziCache[cacheKey] = {
                                  list: this.tiezi_list.slice(),
                                  currentPage: this.currentPage,
                                  noMoreData: this.noMoreData,
                                  suxingFilter: this.suxingFilter
                                };
                                // 持久化缓存到本地存储，减少二次加载
                                try { uni.setStorageSync('tieziCache:'+cacheKey, this.tieziCache[cacheKey]); } catch (err) {}
                              }
        					} else {
        				  // 非加载更多时替换数据
        				  // 非加载更多时替换数据（并发保护：当用户已滚动且当前页>1时，避免覆盖现有列表）
if (this.currentPage <= 1) {
  this.tiezi_list = list;
  // 切换分类或刷新时重置noMoreData状态
  this.noMoreData = false;
}
                              // 同步缓存：保存当前(分类cid + 左侧导航lx + 属性sx)组合的列表与分页状态
                              {
                                const cid = (this.activeIndex && this.activeIndex.id >= 0) ? this.activeIndex.id : 0;
                                const sxId = (typeof this.lastSuxingId === 'number' && this.lastSuxingId >= 0) ? this.lastSuxingId : 0;
                                const lxId = (typeof this.index_suxing === 'number') ? this.index_suxing : 0;
                                const cacheKey = `cid:${cid}|lx:${lxId}|sx:${sxId}`;
                                this.tieziCache[cacheKey] = {
                                  list: this.tiezi_list.slice(),
                                  currentPage: this.currentPage,
                                  noMoreData: this.noMoreData,
                                  suxingFilter: this.suxingFilter
                                };
                                // 持久化缓存到本地存储，减少二次加载
                                try { uni.setStorageSync('tieziCache:'+cacheKey, this.tieziCache[cacheKey]); } catch (err) {}
                              }
        				  // 已在并发保护分支中处理 noMoreData 状态
        				}	
						
						// 确保即使第一次加载就没有数据，也能正确设置noMoreData
						if (!isLoadMore && list.length === 0) {
						  this.noMoreData = true;
						}

					} else {
						uni.showToast({
							icon: 'none',
							title: '获取失败，请稍后重试'
						});
					}
					this.isLoading = false;
					// 分类切换完成，解除滚动加载限制
					this.isSwitchingCategory = false;
					// 释放 uv-tabs 点击锁
					this.tabClickLock = false;
					// 首次进入首页的首屏数据加载完成后，允许后续滚动触发加载
					this.isFirstEnter = false;
				}).catch(() => {
    			  this.isLoading = false;
    				  // 分类切换完成（异常也解除限制），避免长期阻塞滚动加载
    				  this.isSwitchingCategory = false;
    				  // 释放 uv-tabs 点击锁
    				  this.tabClickLock = false;
    				  if (isLoadMore) {
    				    this.currentPage--; // 加载失败时回退页码
    				  }
                  // 异常也视为首屏流程结束，防止始终处于首次进入限制
                  this.isFirstEnter = false;
    			});


			},
			// 下拉加载更多
			// 已统一在页面级 onReachBottom 处理，移除 methods 中的重复定义，避免冲突
			// 帖子
			tiezi(cid,id){
				//console.log(id);	
				try {
  				  // 标记正在导航，阻止触底加载在跳转过程中触发
  				  this.isNavigating = true;
  				  uni.navigateTo({
  				    url: '/pages/tiezi/index?id='+id+'&cid='+cid,
  				    fail: (err) => {
  				      console.error('跳转失败:', err)
  				      // 跳转失败时取消导航标记
  				      this.isNavigating = false;
  				    }
  				  })
  				} catch (e) {
  				  console.error('跳转异常:', e)
  				  this.isNavigating = false;
  				}

			},
			//审核帖子数量
			getShenhe_shu_api(){
				const uid = this.$store.state.memberuid;
                const keycode = this.$store.state.keycode;
				

				var get_data = getRequest(QuanApi.getShenhe_shu(uid,keycode));
				var res;
				get_data.then(duixin_data => {
					res = duixin_data;
					if(res.data.code) {
						
						this.shenhe_shu = res.data.data;
						
					}
				})

			},
			// 审核帖子
			shenhe(){
				uni.navigateTo({
					url: '/pages/shenhe/index',
					fail: (err) => {
					  console.error('跳转失败:', err)
					}
				})
			},
			//个人页面
			getgeren(uid){
				uni.navigateTo({
					url: '/pages/u/index?uid='+uid,
					fail: (err) => {
					  console.error('跳转失败:', err)
					}
				})

			},
			fuwu_gao(id){
			// 跳转
				uni.navigateTo({
					url: '/pages/yingyong/id?id='+id,
					fail: (err) => {
					console.error('跳转失败:', err)
					}
				})
			},
			// 跳转演示
			yanshi(){
				uni.navigateTo({
					url: '/pages/shouce/shouce?id=1&ce=7&yijiid=1',
					fail: (err) => {
					console.error('跳转失败:', err)
					}
				})
			},
			// 跳转演示
			shouce(){
				uni.navigateTo({
					url: '/pages/shouce/shouce?id=1',
					fail: (err) => {
					console.error('跳转失败:', err)
					}
				})
			},
			// 跳转演示
			xiazai(){
				uni.navigateTo({
					url: '/pages/shouce/shouce?id=1&ce=2&yijiid=1',
					fail: (err) => {
					console.error('跳转失败:', err)
					}
				})
			},
			// 跳转演示
			banben(){
				uni.navigateTo({
					url: '/pages/quanzi/index?id=3',
					fail: (err) => {
					console.error('跳转失败:', err)
					}
				})
			},
			// 跳转演示
			wenda(){
				uni.navigateTo({
					url: '/pages/wenda/index',
					fail: (err) => {
					console.error('跳转失败:', err)
					}
				})
			},
			//热门圈子
			get_remen_api(){
				var get_data = getRequest(QuanApi.get_remen_quan());
				var res;
				get_data.then(duixin_data => {
					res = duixin_data;
					if(res.data.code) {
						this.list_remen_data = res.data.data && res.data.data.list;
						
					}
				})
			},
			
			// 图标导航
			get_tubiao_daohang(){
				
				var get_data = getRequest(Api.get_daohang());
				var res;
				get_data.then(duixin_data => {
					res = duixin_data;
					if(res.data.code) {
						
						this.list_tubiao = res.data.data && res.data.data.list;
						
					}
				})
			},
			//推荐帖子
			get_tujian_tie_api(){
				
				var get_data = getRequest(QuanApi.get_tuijian_tie());
				var res;
				get_data.then(duixin_data => {
					res = duixin_data;
					if(res.data.code) {
						
						this.list_tuijian_tie = res.data.data && res.data.data.list;
						
						
					}
				})
			},
			// 图标跳转页面
			go_yemian(ymlx,www){
				if(ymlx == 1){
					uni.navigateTo({
						url: www,
						fail: (err) => {
						  console.error('跳转失败:', err)
						}
					})
				}else if(ymlx == 2){
					uni.switchTab({
						url: www,
						fail: (err) => {
						  console.error('跳转失败:', err)
						}
					})
				}
			},
			go_quan(id){
				uni.navigateTo({
					url: '/pages/quanzi/index?id='+id,
					fail: (err) => {
					  console.error('跳转失败:', err)
					}
				})
			},
			// 网站数据
			handleWwwData(data) {
				this.wwwData = data;
			},
			//版权链接
			duixin(){
				
			},
			denglu_weibu(){
				this.denglu_xianshi_weibu = 1;
			},
			//站点设置
			wwwdataget(deta){
				this.wwwData = deta;
				//console.log('wwwdata',this.wwwData);
			},
			//链接圈子
			quanzi_url(){
				uni.switchTab({
					url: '/pages/quan/index',
					fail: (err) => {
					  console.error('跳转失败:', err)
					}
				})
			},
			shenqing(){
				const uid = this.$store.state.memberuid;
				const keycode = this.$store.state.keycode;
				if (!uid || !keycode) {
				    uni.showToast({
				        title: '未登录',
				        icon: 'none'
				    });
					//this.denglu_xianshi = 1;
					var pc = this.$store.state.kuan.pc;
					if(pc){
						this.denglu_xianshi = 1; //pc
					} else {
						this.denglu_xianshi_weibu = 1; //移动
					}
				    return;
				}
				try {
				  uni.navigateTo({
				    url: '/pages/quan/shenqing',
				    fail: (err) => {
				      console.error('跳转失败:', err)
				    }
				  })
				} catch (e) {
				  console.error('跳转异常:', e)
				}
			},
			//个人信息
			getu_api(){
				// console.log('Calling getu_api with uid:', this.uid);
				var uid = this.$store.state.memberuid;
				var keycode = this.$store.state.keycode;
				if(!uid || !keycode){
					this.u_data = {};
					return;
				}
				const data = {
						uid: uid,
						api_auth_uid: uid,
						api_auth_code: keycode,
					}
				var get_data = getRequest(UApi.getU(),data);
				var res;
				get_data.then(duixin_data => {
					res = duixin_data;
					if(res.data.code) {
						if(uid){
							//this.u_data = res.data.data.wo;
						} else {
							//this.u_data = res.data.data.u;
						}
						this.u_data = res.data.data;
						//console.log('u_data',this.u_data);
						//this.u_data = res.data.data;
						//this.dataLoaded = true;

					}
				})
			},
			get_fuwu_api(){
				var get_data = getRequest(YingyongApi.getYingyong_fuwu());
				var res;
				get_data.then(duixin_data => {
					res = duixin_data;
					if(res.data.code) {

						this.list_fuwu = res.data.data && res.data.data.list;
						// 打印
						//console.log('fuwu',this.list_fuwu);
						// 数据加载完成后重新计算宽度
						this.$nextTick(() => {
							this.getFuwuGaoWidth();
						});
					}
				})
		    },
			// 计算服务项图片宽度
			getFuwuGaoWidth() {
					this.$nextTick(() => {
						const query = uni.createSelectorQuery().in(this);
						query.select('.fuwu_gao_item').boundingClientRect(rect => {
							if (rect) {
								this.fuwugaozhi = `${rect.width}px`;
								// console.log('服务项宽度:', this.fuwugaozhi);
							} else {
								// 如果获取失败，使用默认值
								this.fuwugaozhi = '100px';
							}
						}).exec();
					});
				}

		},
		
		
		
		
		
		
		
		
		
	}
</script>

<style scoped lang="scss">

	.content {
		display: flex;
		flex-direction: column;
		/*align-items: center;*/
		
		background-color: #f3f3f3;
		padding-top: 70px;
		margin-bottom: 0px;
		
		/*height: 100vh;*//* 添加全屏 */
		/*width: 100vw;*/ /* 添加全屏*/
		box-sizing: border-box;
		overflow-x: hidden;
		

		
		

	}

	.logo {
		height: 200rpx;
		width: 200rpx;
		margin-top: 200rpx;
		margin-left: auto;
		margin-right: auto;
		margin-bottom: 50rpx;
	}

	.text-area {
		display: flex;
		justify-content: center;
	}

	.title {
		font-size: 36rpx;
		color: #8f8f94;
	}
	/* 屏幕宽度大于786px时隐藏uni-page-head */
    @media (min-width: 786px) {
        uni-page-head {
            display: none !important;
            opacity: 0 !important;
            height: 0 !important;
            visibility: hidden !important;
        }
    }
	/*.d-daohang{
		
		width: 600rpx;
	}*/
	/* 添加在style部分 */
	.d-daohang-zuo {
    position: fixed;
    left: 0;
    
    width: 180rpx;
    height: calc(100vh - 70rpx);
    background: #f5f5f5;
    z-index: 100;
	box-shadow: 2px 0 5px rgba(177, 177, 177, 0.1);
  }
  
  .d-daohang-you {
    position: fixed;
    left: 180rpx;
    
    width: 180rpx;
    height: calc(100vh - 70rpx);
    background: #fff;
    z-index: 100;
    box-shadow: 2px 0 5px rgba(0,0,0,0.1);
  }
   
   
   
   
   
   
   
   
   
 
   
  .d-erji-item {
    height: 60rpx;
    line-height: 60rpx;
    padding: 0 20rpx;
   /* border-bottom: 1px solid #f0f0f0;*/
  }
  
  .d-erji-item:active {
    background: #f5f5f5;
  }
  .you-guding {
	position: fixed;
	top: 0; /* 根据头部高度调整 */
	/*box-shadow: -2px 0 5px rgba(0,0,0,0.1);*/
	transition: all 0.3s ease;
}
/* 大于786px时的样式 */
@media screen and (min-width: 1024px) {
	.d-bianhua-10 {
		padding: 30px;
	}
	.pc-zuo-520 {
		margin-left: 520rpx;
	}
	.you-guding {
		position: fixed;
			
		top: 60px; /* 根据头部高度调整 */
		/*box-shadow: -2px 0 5px rgba(0,0,0,0.1);*/
		transition: all 0.3s ease;
	}
		
	
}
	
.d-video-height {
    max-height: 250px;
}
.d-cengci{
	position: relative;  
}
.d-wen-tubiao {
	width: 50rpx;
	height: 50rpx;
	line-height: 50rpx;
	text-align: center;
	font-size: 30rpx;
	color: #fff;
	background-color: #fe6881;
	border-radius: 20%;
}
.d-diy-tubiao {
	width: 50rpx;
	height: 50rpx;
	line-height: 50rpx;
	text-align: center;
	font-size: 30rpx;
	color: #fff;
	
	border-radius: 20%;
}
</style>
